Commit Graph

38650 Commits

Author SHA1 Message Date
Norbert Pocs
43033e129b Remove the c_rehash script
The `openssl rehash` should be used instead.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29427)
2025-12-19 16:10:24 +01:00
Richard Levitte
3a06643251 test/run_tests.pl: Ensure that all HARNESS_VERBOSE values are respected
... with perl truthiness in mind

Most of all, this means not having undue expectations that its value
is numerical (this is particularly true when HARNESS_VERBOSE isn't given
by the user, and this script's default is "yes").

We do this by ensuring that $tap_verbosity is turned into an appropriate
number if HARNESS_VERBOSE's value isn't numerical.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29443)
2025-12-19 15:55:34 +01:00
Danny Tsen
ebd690b1eb ppc64le: Restore VSX registers in AES/GCM ppc64le encrypt/decrypt
The implementation failed to restore VSX vector registers from vs14-vs22.

Re-implemented based on Linux kernel version.

Fixes #28961

Signed-off-by: Danny Tsen <dtsen@us.ibm.com>

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28990)
2025-12-19 15:08:27 +01:00
Milan Broz
706606c008 Add engine stubs test
This test tries to use all stub macros and compare return values
to verify that OPENSSL_ENGINE_STUBS define works.

Fixes openssl/project#1762

Signed-off-by: Milan Broz <gmazyland@gmail.com>

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29414)
2025-12-19 09:03:42 -05:00
Milan Broz
9ce72b90eb Remove ossl_err_load_ENGINE_strings from stubs
This was an internal function and should not be here.

Signed-off-by: Milan Broz <gmazyland@gmail.com>

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29414)
2025-12-19 09:03:42 -05:00
Milan Broz
807fd8bc09 Fix stub definitions for no-deprecated config
Used types are only available if OPENSSL_NO_DEPRECATED_3_0
is not defined.

Signed-off-by: Milan Broz <gmazyland@gmail.com>

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29414)
2025-12-19 09:03:42 -05:00
Milan Broz
8d58b05b28 Fix typo in engine.h stub
Signed-off-by: Milan Broz <gmazyland@gmail.com>

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29414)
2025-12-19 09:03:41 -05:00
Simo Sorce
eea8db4124 Harden digest context deserialization
The deserialization functions for SHA2 and SHA3 digest contexts did not
sufficiently validate the incoming data. Corruption in transmission or
on saved disk data could cause a out-of-bounds memory access if buffer
sizes did not match expected values.

Add sanity checks to the SHA2 and SHA3 deserialization functions to validate
buffer-related fields before they are used. The serialization format for these
digests has been changed to place these critical fields early in the stream to
enable this validation.

Additionally, add a note to the EVP_DigestInit man page to warn users that
deserialization should only be performed on trusted data. The checks we
implement are not meant to address processing of untrusted data
maliciously crafted by an attacker.

Application that need to store data or transmit it through untrusted
media SHOULD implement proper encryption and message authentication
on their own using things like CMS or other appropriate secure message
containers.

These check have been added also to quiet a bit security researchers
that try to find any way to claim CVE bounties even in completely
unlikely or invalid scenarios.

Signed-off-by: Simo Sorce <simo@redhat.com>

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29404)
2025-12-19 14:23:04 +01:00
slontis
e1e04709de evp_test Fix tests that were always skipped
The "Verify-Message" type looks for private keys only,
which meant anything using a public key got skipped.
Changed the entries to "Verify-Message-Public" which tries the public
key first.
This uncovered one test that needed to be removed since ECDSA-MD5 is not
a valid fetchable algorithm (in any OpenSSL provider).

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28040)
2025-12-19 08:08:12 -05:00
Eugene Syromiatnikov
b16a53862c util: add reformat-patches script
A small script that tries to perform reformatting of a patch set.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29356)
2025-12-19 08:02:47 -05:00
Richard Levitte
cfbd2e1bae Use 'codespell:ignore' where justifiable
There's this one random string where we have the word "Hellow".  It's a
random string, "correct" spelling is really not important, so we tell
codespell to just ignore that line.

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29437)
2025-12-19 13:06:04 +01:00
Richard Levitte
dc7f7f01ad Fix legitimate spelling errors
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29437)
2025-12-19 13:06:04 +01:00
Richard Levitte
e2b15858a7 Adjust .codespellrc
- add 'external/*' to the list of patterns to skip
- add '*.csr' to the list of patterns to skip

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29437)
2025-12-19 13:06:04 +01:00
Bob Beck
4036f4b0e3 Add new public API for checking certificate times.
Fixes: #1631

This changes the previously internal ossl_x509_check_certificate_times()
to be the public X509_check_certificate_times(). It adds documentation
for the new function and marks X509_cmp_time, X509_cmp_timeframe,
and X509_cmp_current_time as deprecated in 4.0, as discussed in #1631.

Since the function is now public, we can replace the remaining
uses of deprecated stuff with this function.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29152)
2025-12-18 13:34:58 -05:00
Weizhi Ao
5cbbced70d Fix silent failure in ASYNC_start_job when size is 0
When ASYNC_start_job is called with args != NULL but size == 0,
OPENSSL_malloc(0) is called. Depending on the libc implementation,
malloc(0) may return NULL, causing a silent failure.

This patch modifies the logic to skip allocation if size is 0.

CLA: trivial

Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29377)
2025-12-18 17:34:42 +01:00
Matthias Kraft
576efc44ae Ensure path to libcrypto can be resolved on AIX.
On AIX, the environment of the test executable for test_includes doesn't
contain a resolvable search path to the just built libcrypto. Setup
LIBPATH to point to the build results.

Fixes #29352.

Signed-off-by: Matthias Kraft <Matthias.Kraft@ibm.com>

Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29375)
2025-12-18 17:32:37 +01:00
martin
f13fe0e025 Add documentation for X509_V_FLAG_OCSP_RESP_CHECK and X509_V_FLAG_OCSP_RESP_CHECK_ALL
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29327)
2025-12-18 17:31:13 +01:00
Dr. David von Oheimb
c8073cac15 apps/x509.c: factor out add_object() for handling -addtrust and -addreject options
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/28371)
2025-12-18 17:28:53 +01:00
Milan Broz
0ccd3a238f Add mention of OPENSSL_ENGINE_STUBS to openssl_user_macros(7)
Fixes openssl/project#1743
Fixes openssl/project#1744

Signed-off-by: Milan Broz <gmazyland@gmail.com>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29424)
2025-12-18 16:55:39 +01:00
Matt Caswell
c28576e784 Add removed EVP_PKEY_meth* functions to ossl-removed-api.pod
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:50 +00:00
Matt Caswell
d7a4f81aed Remove all EVP_PKEY_meth_* functions from the documentation
These functions have been removed so the documentation should be updated
accordingly.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:39 +00:00
Matt Caswell
60d4b986e7 Clean up some final vistigial remnants of EVP_PKEY_METHOD
We retain the opaque type because it is still used by the ENGINE stubs.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:39 +00:00
Matt Caswell
00022fdfad Remove references to the pmeth field in an EVP_PKEY_CTX
We don't set this field anymore so we should remove all usage of it.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
a570f1a09b Delete the EC EVP_PKEY_METHOD
It is no longer used so can be removed

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
90bb6e2c93 Delete the DSA EVP_PKEY_METHOD
It is no longer used so can be removed

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
b7d69bad17 Delete the RSA EVP_PKEY_METHOD
It is no longer used so can be removed

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
7fd85ef726 Delete the ECX EVP_PKEY_METHOD
It is no longer used so can be removed

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
ce6a336128 Delete the DH EVP_PKEY_METHOD
It is no longer used so can be removed

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Matt Caswell
f3f70e170f Remove custom EVP_PKEY_METHODs
We retain custom EVP_PKEY_ASN1_METHODs for now - to be removed in some
subsequent PR.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29384)
2025-12-18 10:57:38 +00:00
Norbert Pocs
53b78f2a49 Check return code of UTF8_putc
Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29376)
2025-12-18 11:23:09 +01:00
Norbert Pocs
51e8f70ba3 Harden ASN1_mbstring_ncopy
Reported by Murali Aniruddhan

Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29376)
2025-12-18 11:23:09 +01:00
Alexandr Nedvedicky
5a45547c8e The stream garbage collector loop in ossl_quic_stream_map_gc() is never entered
Also remove ready_for_gc_next(), it is not needed any more.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29402)
2025-12-18 11:11:03 +01:00
Ondrej Moris
e547988940 Revert "tests: temporarily skip MLDSA pkcs11-provider test"
This reverts commit 2b97f4d300.

Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28717)
2025-12-17 15:07:40 -05:00
Richard Levitte
16fa01bb86 Add a couple of DH related StatementMacros, and adjust
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
7996349056 Unbreak some function signature that got broken up after the return type
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
63e912b758 Redo source reformatting with the TypeNames added
This resulted in some source reformatting becoming a bit less trippy

This is the script I used to run clang-format appropriately enough:

    #! /bin/bash

    include_re=$(yq -r '.repos.[].hooks.[] | select(.id == "clang-format") | .files' < .pre-commit-config.yaml)
    known_generated=( crypto/bn/bn_prime.h
                      crypto/objects/obj_dat.h
                      crypto/objects/obj_xref.h
                      include/openssl/obj_mac.h
                      crypto/conf/conf_def.h
                      crypto/asn1/charmap.h
                      '*_err.c'
                      '*err.h' )

    exclusions=()
    for g in "${known_generated[@]}"; do
        # Convert pattern to a regex
        g=${g//\./\\.}
        g=${g//\*/.\*}
        exclusions+=( "^${g}\$" )
    done
    # Join all exclusions into one regex
    exclude_re=$(IFS='|'; echo "${exclusions[*]}")

    (set -x; git ls-files | grep -E $include_re | grep -Ev $exclude_re | xargs clang-format -i)

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
aa9defaa1f Dump all known typedefs into .clang-format
This was done by calling a script I made on the spot:

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

This is what that script looked like:

    #! /bin/bash

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

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

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

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

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

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
a999136e01 Refactor types that are '#define'd into proper typedefs
I looked for them with the following grep pipe, and then read through
the output to discern what are actual type definitions, and converted
what I found manually.

    git grep -En -e '#define [a-zA-Z_0-9]+ ' -- '*.h' \
        | sed -e 's|//.*||' -e 's|/\*.*\*/||g' \
        | grep -Ev ' ([0-9]|.*".*|.*\\$)'

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
821b265d21 Add a few more ASN.1 related StatementMacros
This resulted in an adjustment of reformatting that is a bit less trippy
in some places.

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Richard Levitte
92d1ea3bf2 Missed a spot!
For some reason, source reformatting didn't catch everything.

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29383)
2025-12-17 10:19:43 -05:00
Bob Beck
131c2a1adb Defang the lhash test
This is bascially eating my mac, as it now runs for 80 seconds
and eats all the CPU's exercising lock contention.

This dials it back to consume at most a quarter of the CPU's in
use by HARNESS_JOBS, unless LHASH_WORKERS is set to override it
in which case we use that.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/29406)
2025-12-17 08:45:38 -05:00
Tomas Mraz
495cf0efe6 apps/req.c: Always set permissions for private key output
The key output will be always private.

Reported with a proposed fix by Stanislav Fort (Aisle Research).

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29397)
2025-12-17 13:47:29 +01:00
Neil Horman
a28accadf7 Fix Coverity issue in kdf_snmpkdf_set_ctx_params
Coverity flagged a use before NULL check error in
kdf_snmpkdf_set_ctx_params.

In this function the ctx pointer was dereferenced to obtain a
OSSL_LIB_CTX pointer, and only after that dereference was ctx checked
for being NULL.

fix is pretty clear, just move the OSSL_LIB_CTX computation down to a
point after ctx is checked for NULL.

fixes openssl/project#1765

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29400)
2025-12-17 13:45:22 +01:00
Viktor Dukhovni
473dff4781 New -encopt option for pkey(1) and genpkey(1)
This allows setting the ML-KEM and ML-DSA output formats.
At the same fixing surprising lack of password encryption
of PKCS#8 private keys in DER output form in the CLI apps.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29324)
2025-12-17 13:40:17 +01:00
Viktor Dukhovni
29f8cebfcb Fix codespell error in sslapitest
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29392)
2025-12-17 13:33:09 +01:00
Paul Elliott
ddcfc1a1be Fix error in PAC/BTI AArch64 build
Clang format removes a space here, which creates a compiler error when
building for PAC/BTI. Fix this and Turn off clang format for this line

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/29399)
2025-12-17 13:17:09 +01:00
Bob Beck
ac7f76380b Make the test output show how long each test takes by default.
Unless we have reduced the verbosity level, or overridden it with
a HARNESS_TIMER setting.

This makes it easier to realize when you are making a test that is
starting to dominate testing time for developers, and makes it
easier for developers to see it.

For: https://github.com/openssl/project/issues/1767

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/29408)
2025-12-17 13:09:52 +01:00
Nikola Pajkovsky
6255955d08 method store performance improvements
The proposed architectural change focuses on improving concurrency and
reducing contention within the method store. The fundamental concept
involves moving away from a monolithic synchronisation
mechanism—specifically, a single read-write lock (rwlock)—that
currently guards the entire method store.

Instead of this single point of contention, the strategy is to
introduce per-shard synchronisation. This means the method store will
be partitioned, or sharded, into several independent segments. Each of
these segments, or shards, will be protected by its own dedicated
read-write lock.

The data in the table below was generated by running evp_fetch twenty times per thread.

|---------+----------+---------+---------+---------+---------+---------+---+--------+--------+--------+--------+--------|
|                    | Shards (u/sec)                                  |   | Improvements %
|---------+----------+---------+---------+---------+---------+---------+---+--------+--------+--------+--------+--------|
| Threads | Base     |       2 |       4 |       8 |      16 |      32 |   |      2 |      4 |      8 |     16 |     32 |
|---------+----------+---------+---------+---------+---------+---------+---+--------+--------+--------+--------+--------|
|       1 |  0.18282 | 0.18497 | 0.18306 | 0.18314 | 0.18485 | 0.18352 |   |   1.17 |   0.13 |   0.18 |   1.11 |   0.39 |
|       2 |  0.43588 | 0.35560 | 0.34131 | 0.32516 | 0.33948 | 0.35076 |   | -18.42 | -21.70 | -25.40 | -22.12 | -19.53 |
|       4 |  1.58185 | 1.06459 | 1.06258 | 0.98698 | 0.98700 | 1.06689 |   | -32.70 | -32.83 | -37.61 | -37.60 | -32.55 |
|       8 |  3.15686 | 1.75061 | 1.67458 | 1.50241 | 1.62453 | 1.74750 |   | -44.55 | -46.95 | -52.41 | -48.54 | -44.64 |
|      16 |  5.53647 | 2.83137 | 2.58007 | 2.65972 | 2.64882 | 2.82755 |   | -48.86 | -53.40 | -51.96 | -52.16 | -48.93 |
|      32 | 10.72727 | 4.97483 | 4.43692 | 4.52524 | 4.68358 | 4.84840 |   | -53.62 | -58.64 | -57.82 | -56.34 | -54.80 |
|      64 | 21.12103 | 9.43241 | 7.79981 | 7.91148 | 8.33305 | 8.34230 |   | -55.34 | -63.07 | -62.54 | -60.55 | -60.50 |

Perf tests were running on the system:
  Architecture: x86_64
  CPU op-mode(s): 32-bit, 64-bit
  Address sizes: 46 bits physical, 48 bits virtual
  Byte Order: Little Endian
  CPU(s): 96
  On-line CPU(s) list: 0-95
  Vendor ID: GenuineIntel
  Model name: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz
  CPU family: 6
  Model: 85
  Thread(s) per core: 2
  Core(s) per socket: 24
  Socket(s): 2

The most performant option is a configuration with 512 cache entries with
4 shards. There are two new defines NUM_SHARDS, and CACHE_SIZE which
can be tweaked at will.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29205)
2025-12-17 12:29:17 +01:00
Matt Caswell
bc2d17bbc4 Update ossl-removed-api to mention the EVP_MD_meth* functions
All the EVP_MD_meth* functions have been removed so they should be
documented as such.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29366)
2025-12-17 10:23:22 +00:00
Matt Caswell
afe83c9a93 Remove mentions of EVP_MD_meth* from the documentation
With the removal of EVP_MD_meth* we need to update the documentation
accordingly.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29366)
2025-12-17 10:23:22 +00:00