]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
15 hours agoRemove unnecessary OPENSSL_NO_RSA remnants master
Michael Baentsch [Tue, 29 Jul 2025 10:32:00 +0000 (12:32 +0200)] 
Remove unnecessary OPENSSL_NO_RSA remnants

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

15 hours agofuzz/dtlsserver.c: Remove incorrect ifdef guard
Michael Baentsch [Mon, 28 Jul 2025 04:52:49 +0000 (06:52 +0200)] 
fuzz/dtlsserver.c: Remove incorrect ifdef guard

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28102)

15 hours agotest_tlsext_status_type(): Avoid leaking of previously allocated data
Tomas Mraz [Mon, 28 Jul 2025 08:55:45 +0000 (10:55 +0200)] 
test_tlsext_status_type(): Avoid leaking of previously allocated data

Fixes Coverity 165922616592241659223

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28105)

16 hours agoOnly report generic error if provider did not put an error on the error queue
Ingo Franzki [Tue, 22 Jul 2025 13:09:27 +0000 (15:09 +0200)] 
Only report generic error if provider did not put an error on the error queue

Commit 72351b0d18078170af270418b2d5e9fc579cb1af added code to unconditionally
put a generic error onto the error stack, if key generation, encryption,
decryption, sign, or verify fails to ensure that there is an error entry
on the error queue, even if the provider did not itself put a specific error
onto the queue.

However, this can hide error details if an application just looks at the very
last error entry and checks for specific errors. Now, the generic error is
always the last entry, and the application won't find the expected error
entry, although it would be there as second last entry. This can lead to
different application behavior in error situations than before this change.

To fix this, only add 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.

Closes: https://github.com/openssl/openssl/issues/27992
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28073)

16 hours agoMake ERR_count_to_mark() available to providers via 'in' dispatch array
Ingo Franzki [Tue, 22 Jul 2025 13:01:38 +0000 (15:01 +0200)] 
Make ERR_count_to_mark() available to providers via 'in' dispatch array

Functions like ERR_set_mark(), ERR_clear_last_mark(), and ERR_pop_to_mark()
are already passed to the a provider via the 'in' dispatch array of the
provider initialization function (although the documentation did not
mention them).

Also pass ERR_count_to_mark() to the provider the same way, and update
the documentation to mention all four functions.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28073)

18 hours agoFix hanging of test_external_cf_quiche
Eugene Syromiatnikov [Wed, 30 Jul 2025 13:55:14 +0000 (15:55 +0200)] 
Fix hanging of test_external_cf_quiche

The commit "Remove HARNESS_OSSL_PREFIX manipulation in the test harness"
forced all the output to be processed by the test harness, which means
that any process that keeps the stdout FD open prevents the run() call
from finishing, as was the case in the test_external_cf_quiche test that
ran quiche server in the background, but retaining the std{in,out,err}
descriptors.  Avoid that by explicitly redirecting them to a log file.

Reported-by: Tomas Mraz <tomas@openssl.org>
Fixes: 70c05fcde53cf "Remove HARNESS_OSSL_PREFIX manipulation in the test harness"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28125)

22 hours agoImplement KEMRecipientInfo (RFC9629) in CMS
Daniel Van Geest [Thu, 3 Apr 2025 10:19:43 +0000 (11:19 +0100)] 
Implement KEMRecipientInfo (RFC9629) in CMS

Also add support for ML-KEM in CMS (draft-ietf-lamps-cms-kyber).

Add the -recip_kdf and -recip_ukm parameters to `openssl cms -encrypt`
to allow the user to specify the KDF algorithm and optional user
keying material for each recipient.

A provider may indicate which RecipientInfo type is supported
for a key, otherwise CMS will try to figure it out itself. A
provider may also indicate which KDF to use in KEMRecipientInfo
if the user hasn't specified one.

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

33 hours agocrypto: evp: fix potential null pointer dereference in EVP_DigestSignUpdate in m_sigver.c
Anton Moryakov [Fri, 25 Jul 2025 12:43:15 +0000 (15:43 +0300)] 
crypto: evp: fix potential null pointer dereference in EVP_DigestSignUpdate in m_sigver.c

Static analysis detected that EVP_DigestSign() could lead to null pointer
dereference in EVP_DigestSignUpdate() when pctx->pmeth is NULL. The issue
occurs in the legacy code path where pmeth is accessed without prior null
check.

This fix adds a proper null check for pctx->pmeth in the legacy section
of EVP_DigestSignUpdate() to prevent the crash when the function is called
through EVP_DigestSign() with improperly initialized context.

The check is placed in EVP_DigestSignUpdate() rather than EVP_DigestSign()
to maintain proper separation of concerns and follow OpenSSL's architectural
patterns where lower-level functions handle their own parameter validation.

Fixes potential crash in signature operations with legacy providers.

CLA: trivial
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28095)

38 hours agoFix NULL check in get_ocsp_resp_from_responder
Neil Horman [Sat, 26 Jul 2025 13:30:53 +0000 (09:30 -0400)] 
Fix NULL check in get_ocsp_resp_from_responder

We assign an allocation to *sk_resp, but only check for NULL on sk_resp,
not the value it points to.

Addresses https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1659222

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28101)

38 hours agoSet *sk_resp to NULL when freeing.
Neil Horman [Sat, 26 Jul 2025 13:28:01 +0000 (09:28 -0400)] 
Set *sk_resp to NULL when freeing.

Its possible for get_ocsp_resp_from_responder to return OK after having
freed *sk_resp without setting the freed pointer to NULL, leading us to
set a garbage pointer in other code.

Ensure that we set it to NULL after freeing

Addresses https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1659225

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28101)

38 hours agoFix NULL check in bring_oscp_resp_in_correct_order
Neil Horman [Sat, 26 Jul 2025 13:18:11 +0000 (09:18 -0400)] 
Fix NULL check in bring_oscp_resp_in_correct_order

We assign an allocated pointer to *sk_resp but only check if sk_resp is
NULL when sk_resp is a pointer to a pointer

Addresses https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1659227

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28101)

39 hours agoreduce lock contention when adding objects to ADDED_OBJ hash table
Neil Horman [Mon, 14 Jul 2025 13:12:17 +0000 (09:12 -0400)] 
reduce lock contention when adding objects to ADDED_OBJ hash table

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

39 hours agomove added creation to happen outside of write lock
Neil Horman [Sun, 13 Jul 2025 12:51:41 +0000 (08:51 -0400)] 
move added creation to happen outside of write lock

We have a global ADDED_OBJ hashtable, and we check to create it
on every object add with the write lock potentially held.  move that
creation to a RUN_ONCE routine so that its always created before the
write lock is held

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

39 hours agounix-Makefile.tmpl: Run find-doc-nits with env var checker too
Norbert Pocs [Fri, 18 Jul 2025 12:29:57 +0000 (14:29 +0200)] 
unix-Makefile.tmpl: Run find-doc-nits with env var checker too

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agofind-doc-nits: Check env var documentation
Norbert Pocs [Thu, 17 Jul 2025 13:42:44 +0000 (15:42 +0200)] 
find-doc-nits: Check env var documentation

Check the code (source files and .in files) for undocumented ENV
variable names. The variable name should be documented in openssl-env or
in a designated man page in the "ENVIRONMENT" section.

Resolves: https://github.com/openssl/openssl/issues/28050

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man1/openssl-rehash.pod.in: document PATH environment variable
Eugene Syromiatnikov [Tue, 22 Jul 2025 03:06:30 +0000 (05:06 +0200)] 
doc/man1/openssl-rehash.pod.in: document PATH environment variable

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document HOME environment variable usage
Eugene Syromiatnikov [Mon, 14 Jul 2025 08:26:28 +0000 (10:26 +0200)] 
doc/man7/openssl-env: document HOME environment variable usage

Seems to be the only place where it is used, as of now.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document OPENSSL_TEST_LIBCTX environment variable
Eugene Syromiatnikov [Mon, 14 Jul 2025 08:25:41 +0000 (10:25 +0200)] 
doc/man7/openssl-env: document OPENSSL_TEST_LIBCTX environment variable

Complements: e89578be2930 "Test RSA oaep in fips mode"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: OPENSSL_TRACE: tfix
Eugene Syromiatnikov [Mon, 14 Jul 2025 08:29:56 +0000 (10:29 +0200)] 
doc/man7/openssl-env: OPENSSL_TRACE: tfix

Fixes: ee0bf38e8709 "improve and move text on OPENSSL_TRACE from doc/man1/openssl.pod to doc/man7/openssl-env.pod"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: sort OPENSSL_TRACE categories lexicographically
Eugene Syromiatnikov [Mon, 14 Jul 2025 07:53:51 +0000 (09:53 +0200)] 
doc/man7/openssl-env: sort OPENSSL_TRACE categories lexicographically

There is little reason to preserve the declaration order for the reader.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: update REF_COUNT OPENSSL_TRACE category description
Eugene Syromiatnikov [Tue, 22 Jul 2025 01:58:38 +0000 (03:58 +0200)] 
doc/man7/openssl-env: update REF_COUNT OPENSSL_TRACE category description

It seems that its usage has been changed since the initial mention
in 6d594fdf52c4 "OSSL_trace_set_channel.pod and openssl.pod:
fix missing/inconsistent category items".

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document QUERY OPENSSL_TRACE category
Eugene Syromiatnikov [Mon, 14 Jul 2025 07:47:26 +0000 (09:47 +0200)] 
doc/man7/openssl-env: document QUERY OPENSSL_TRACE category

Complements: eed43f8a12ef "Add a QUERY trace category"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document PROVIDER OPENSSL_TRACE category
Eugene Syromiatnikov [Mon, 14 Jul 2025 07:45:54 +0000 (09:45 +0200)] 
doc/man7/openssl-env: document PROVIDER OPENSSL_TRACE category

Complements: 93296eaaa0e8 "Adding a trace category for PROVIDER calls"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: reword the description
Eugene Syromiatnikov [Mon, 14 Jul 2025 07:43:07 +0000 (09:43 +0200)] 
doc/man7/openssl-env: reword the description

The manual page describes not only environment variables that pertain
the library, but some of the applications as well (OPENSSL,
OPENSSL_CONFIG, and TSGET are possible examples).  Also, the effect
of the variables is not limited to the changes in default paths.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document which variables are considered security-sensitive
Eugene Syromiatnikov [Fri, 11 Jul 2025 18:10:50 +0000 (20:10 +0200)] 
doc/man7/openssl-env: document which variables are considered security-sensitive

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: document OPENSSL_DEBUG_DECC_INIT environment variable
Eugene Syromiatnikov [Fri, 11 Jul 2025 17:50:41 +0000 (19:50 +0200)] 
doc/man7/openssl-env: document OPENSSL_DEBUG_DECC_INIT environment variable

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoDocument LEGACY_GOST_PKCS12 environment variable
Eugene Syromiatnikov [Fri, 11 Jul 2025 17:23:39 +0000 (19:23 +0200)] 
Document LEGACY_GOST_PKCS12 environment variable

Add its mention to doc/man7/openssl-env.pod and describe its semantics
in doc/man3/PKCS12_gen_mac.pod.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoDocument OPENSSL_MALLOC_SEED environment variable
Eugene Syromiatnikov [Fri, 11 Jul 2025 12:49:22 +0000 (14:49 +0200)] 
Document OPENSSL_MALLOC_SEED environment variable

Add its mention to doc/man3/OPENSSL_malloc.pod,
doc/man7/openssl-env.pod, and util/other.syms.

Also, reorder the variable order in doc/man7/openssl-env.pod
to a lexicographical one.

Complements: 3df5736cf303 "Improve Malloc Failure Test"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man3/OPENSSL_malloc: improve OPENSSL_MALLOC_FAILURES documentation
Eugene Syromiatnikov [Fri, 11 Jul 2025 12:24:59 +0000 (14:24 +0200)] 
doc/man3/OPENSSL_malloc: improve OPENSSL_MALLOC_FAILURES documentation

Reflect its ability to accept floating point numbers in the failure
probability specification.

Complements: 3df5736cf303 "Improve Malloc Failure Test"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env.pod: document HARNESS_OSSL_PREFIX environment variable
Eugene Syromiatnikov [Thu, 10 Jul 2025 17:08:54 +0000 (19:08 +0200)] 
doc/man7/openssl-env.pod: document HARNESS_OSSL_PREFIX environment variable

For historical purposes.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: sort *_PROXY environment variables, add lowercase variants
Eugene Syromiatnikov [Fri, 11 Jul 2025 15:40:22 +0000 (17:40 +0200)] 
doc/man7/openssl-env: sort *_PROXY environment variables, add lowercase variants

Sort HTTP_PROXY, HTTPS_PROXY, and NO_PROXY in lexicographical order, add
mentions of the lowercase variants of the variables (as they are already
mentioned in OSSL_HTTP_parse_url(3)), in the same order, despite
it is not a lexicographical one, do minimise confusion.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoDocument SSL_CIPHER environment variable
Eugene Syromiatnikov [Thu, 10 Jul 2025 17:05:33 +0000 (19:05 +0200)] 
Document SSL_CIPHER environment variable

It is apparently checked/used by openssl s_time when -cipher option
is not set.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: sort the variables in lexicographical order
Eugene Syromiatnikov [Thu, 10 Jul 2025 13:49:05 +0000 (15:49 +0200)] 
doc/man7/openssl-env: sort the variables in lexicographical order

The initial commit that has added the manual page (22bb8c254555 "Document
more env var stuff, fix some typo's") had them sorted.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agodoc/man7/openssl-env: sort the capability envvars/links lexicographically
Eugene Syromiatnikov [Thu, 10 Jul 2025 13:21:33 +0000 (15:21 +0200)] 
doc/man7/openssl-env: sort the capability envvars/links lexicographically

Put the mentions of OPENSSL_*cap environment variables and man page
references in lexicographical order.  Also, add an Oxford comma before
"and" in the man page references.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoutil/other.syms: sort OPENSSL_*cap lexicographically, add missing variables
Eugene Syromiatnikov [Fri, 11 Jul 2025 12:46:24 +0000 (14:46 +0200)] 
util/other.syms: sort OPENSSL_*cap lexicographically, add missing variables

The list includes OPENSSL_ia32cap, OPENSSL_riscvcap, and OPENSSL_s390xcap,
but not OPENSSL_armcap, OPENSSL_ppccap, or OPENSSL_sparcv9cap;  fix that.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoapps/lib/apps.c: remove HARNESS_OSSL_PREFIX envvar handling
Eugene Syromiatnikov [Mon, 21 Jul 2025 11:37:16 +0000 (13:37 +0200)] 
apps/lib/apps.c: remove HARNESS_OSSL_PREFIX envvar handling

As the environment variable is no longer used by the test harness,
its support can be removed from the openssl command, along
with the possible unintended consequences of prefixing the standard
output of the openssl command with an arbitrary string set
in the environment.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

39 hours agoRemove HARNESS_OSSL_PREFIX manipulation in the test harness
Eugene Syromiatnikov [Mon, 21 Jul 2025 11:32:24 +0000 (13:32 +0200)] 
Remove HARNESS_OSSL_PREFIX manipulation in the test harness

The aim of HARNESS_OSSL_PREFIX environment variable is to avoid contaminating
TAP producer's output with stanzas that can be interpreted by a TAP producer
by prefixing them with comment;  this can be achieved by processing
the output within the runner instead, as it already does for non-standard
prefixes;  it also has the added benefit of alleviating the need
to reset it for the external tests in order to avoid messing
with their output checks.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

43 hours agoPairwise check for DH keys import as part of FIPS
Nikola Pajkovsky [Thu, 17 Jul 2025 10:45:49 +0000 (12:45 +0200)] 
Pairwise check for DH keys import as part of FIPS

For DH key import, it appears the PCT and assurances are implemented in
the source but are not be performed by default.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28058)

43 hours agoUpdate dh_pub to be pairwise consistent with dh_priv
Nikola Pajkovsky [Wed, 16 Jul 2025 12:37:58 +0000 (14:37 +0200)] 
Update dh_pub to be pairwise consistent with dh_priv

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28058)

2 days agoExchange no-sm2 and no-ssl-trace between on PR and daily jobs
Tomas Mraz [Mon, 28 Jul 2025 09:15:52 +0000 (11:15 +0200)] 
Exchange no-sm2 and no-ssl-trace between on PR and daily jobs

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

2 days agotest-ec: Skip SM2 key import test if SM2 is disabled
Tomas Mraz [Mon, 28 Jul 2025 09:13:06 +0000 (11:13 +0200)] 
test-ec: Skip SM2 key import test if SM2 is disabled

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

3 days agoFixed #27506, now the behavior with an empty IDN is the same as with
Igor Ustinov [Wed, 23 Jul 2025 17:48:50 +0000 (20:48 +0300)] 
Fixed #27506, now the behavior with an empty IDN is the same as with
an incorrect IDN.

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

3 days ago- adding a missing file
Alexandr Nedvedicky [Tue, 22 Jul 2025 21:31:57 +0000 (23:31 +0200)] 
- adding a missing file

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

3 days ago- changes suggested by @t8m
Alexandr Nedvedicky [Tue, 22 Jul 2025 20:59:28 +0000 (22:59 +0200)] 
- changes suggested by @t8m

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

3 days ago- fix RFC reference and indentation
sashan [Mon, 21 Jul 2025 06:57:41 +0000 (08:57 +0200)] 
- fix RFC reference and indentation

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

3 days agoUpdate ssl/quic/quic_ackm.c
Sashan [Mon, 21 Jul 2025 06:44:17 +0000 (08:44 +0200)] 
Update ssl/quic/quic_ackm.c

Co-authored-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28023)

3 days agoUpdate ssl/quic/quic_ackm.c
Sashan [Mon, 21 Jul 2025 06:43:49 +0000 (08:43 +0200)] 
Update ssl/quic/quic_ackm.c

Co-authored-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28023)

3 days agoACK manager must avoid infinite probe time when waiting handshake confirmation
sashan [Tue, 15 Jul 2025 13:09:40 +0000 (15:09 +0200)] 
ACK manager must avoid infinite probe time when waiting handshake confirmation

According to RFC 9002, section 6.2.2.1 the client the client must keep PTO (probe
time out) armed if it has not seen HANDSHAKE_DONE quic message from server.
Not following RFC spec here may cause the QUIC session to stale during TLS handshake.

Fixes openssl/project#1266

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

4 days agoAdd a test of 'openssl storeutl' with a BER-encoded PKCS#12 file
Richard Levitte [Wed, 16 Jul 2025 13:08:48 +0000 (15:08 +0200)] 
Add a test of 'openssl storeutl' with a BER-encoded PKCS#12 file

The test file (test-BER.p12) was given to us by David von Oheimb

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

4 days agoFix OSSL_STORE to consider cached info in the EOF check.
Richard Levitte [Thu, 10 Jul 2025 15:55:50 +0000 (17:55 +0200)] 
Fix OSSL_STORE to consider cached info in the EOF check.

OSSL_STORE_load() called OSSL_STORE_eof() before checking if there is
cached OSSL_STORE_INFO to consider.  To fix this issue, the cached info
check is moved to OSSL_STORE_eof(), as that seems to make most common
sense.

This solves an issue with PKCS#12 files, where the cached info was never
considered because the underlying file IO layer signaled that EOF is
reached.

Fixes #28010

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

5 days agoUpdate workflows to test msquic with OpenSSL
Andrew Dinh [Wed, 16 Jul 2025 14:24:28 +0000 (21:24 +0700)] 
Update workflows to test msquic with OpenSSL

Update GitHub Workflows to build msquic with OpenSSL with TLS backend, push to Quay.io, and test with current QUIC interop workflow

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

5 days agoAdd support for TLS 1.3 OCSP multi-stapling for server certs
martin [Fri, 7 Feb 2025 13:22:41 +0000 (14:22 +0100)] 
Add support for TLS 1.3 OCSP multi-stapling for server certs

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

5 days agosm2: sm2_sign.c: check EC_KEY_get0_private_key() for NULL in sm2_sig_gen()
AntonMoryakov [Mon, 2 Jun 2025 10:14:28 +0000 (13:14 +0300)] 
sm2: sm2_sign.c: check EC_KEY_get0_private_key() for NULL in sm2_sig_gen()

Static analysis revealed that sm2_sig_gen() dereferences the return value
of EC_KEY_get0_private_key() without checking for NULL. This could lead to
a crash if the private key is unset.

This patch adds a NULL check and raises ERR_R_PASSED_NULL_PARAMETER if the
key is missing.

Issue found by static analyzer:
> Return value of EC_KEY_get0_private_key() is dereferenced without checking for NULL (11/12 checked)

CLA: trivial
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27741)

6 days agofix SM2 privatekey decode(PEM format, ECPrivateKey).
Alen Yan [Wed, 9 Jul 2025 01:23:00 +0000 (09:23 +0800)] 
fix SM2 privatekey decode(PEM format, ECPrivateKey).

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

6 days agoopenssl rand command should use the loaded library context
Daniel Van Geest [Wed, 23 Jul 2025 08:30:57 +0000 (10:30 +0200)] 
openssl rand command should use the loaded library context

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

6 days agotest/timing_load_creds.c: Add fclose() if error occurs
Jiasheng Jiang [Wed, 9 Jul 2025 21:10:51 +0000 (21:10 +0000)] 
test/timing_load_creds.c: Add fclose() if error occurs

Add fclose() if error occurs to release fp.

Fixes: 6212fc6814 ("Add a stand-alone "timing" program")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28007)

7 days agoLoongArch: Add SHA-512 assembly implementation for better performance on small-size... feature/quic-0-rtt
Julian Zhu [Thu, 26 Jun 2025 06:14:45 +0000 (14:14 +0800)] 
LoongArch: Add SHA-512 assembly implementation for better performance on small-size data

Signed-off-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27904)

7 days agoLoongArch: Add SHA-256 assembly implementation for better performance
Julian Zhu [Fri, 20 Jun 2025 07:59:08 +0000 (15:59 +0800)] 
LoongArch: Add SHA-256 assembly implementation for better performance

It can get about 25%~ better performance than compiler-generated code (gcc version 15.1.1).

Signed-off-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27904)

7 days ago--amend
Dmitry Misharov [Tue, 22 Jul 2025 06:58:27 +0000 (08:58 +0200)] 
--amend

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27467)

7 days agoreplace GitHub Actions in Windows jobs
Dmitry Misharov [Tue, 22 Apr 2025 06:37:45 +0000 (08:37 +0200)] 
replace GitHub Actions in Windows jobs

Most of the GitHub Actions can be replaced with a couple of commands.
This will reduce dependencies bloating and some attacks surface.
This commit replaces all GitHub Actions which are not from GitHub
and Cygwin for Windows jobs with plain commands.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27467)

7 days agoFix perl warnings on various scripts
Norbert Pocs [Tue, 15 Jul 2025 09:54:23 +0000 (11:54 +0200)] 
Fix perl warnings on various scripts

Resolves: https://github.com/openssl/project/issues/1273

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@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/28046)

8 days agosm2: add some signing tests.
Pauli [Wed, 9 Jul 2025 02:54:21 +0000 (12:54 +1000)] 
sm2: add some signing tests.

Because SM2 uses entropy as part of it's signing process, there were no
signing tests under evp_test.  This corrects the shortcoming.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27997)

8 days agoevp_test: add a new global "Test-Entropy" line to allow deterministic `random` input.
Pauli [Wed, 9 Jul 2025 02:50:02 +0000 (12:50 +1000)] 
evp_test: add a new global "Test-Entropy" line to allow deterministic `random` input.

When specified, this directive replaces the public and private DRBGs
with a generator that returns the specified bytes.  If more bytes are
requested than are specified, the generator loops around the supplied
bytes to satisfy the request.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27997)

8 days agosm2 test: remove unnecessary available in lines
Pauli [Tue, 8 Jul 2025 23:40:16 +0000 (09:40 +1000)] 
sm2 test: remove unnecessary available in lines

This test is only run against the default provider so no need to double
check this.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27997)

8 days agoECX/ED keymanager param getter fixes.
slontis [Tue, 15 Jul 2025 02:54:04 +0000 (12:54 +1000)] 
ECX/ED keymanager param getter fixes.

Fixes #28034

ECX and ED were sharing the same code for the getter, whilst also
maintaining seperate gettable tables.

The code has been reworked so that common code is shared, and algorithm
specific code is seperated out to make this clearer.

This fixes:
(1) The security category not being in the gettable table for ED
(2) The fips indicator for ED. i.e There is no fips indicator for ED
(previously there was no gettable, but the get() still tried to return
unapproved).

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

9 days agoRaise PROV_R_NULL_OUTPUT_BUFFER if shsec is NULL in ml_kem_encapsulate()
lanming [Thu, 10 Jul 2025 02:20:05 +0000 (10:20 +0800)] 
Raise PROV_R_NULL_OUTPUT_BUFFER if shsec is NULL in ml_kem_encapsulate()

Signed-off-by: lanming <lanming@huawei.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28009)

9 days agoAdd CODEOWNERS file
Dmitry Misharov [Fri, 18 Jul 2025 06:12:56 +0000 (08:12 +0200)] 
Add CODEOWNERS file

quarckster is the owner of the /.github/workflows/ directory.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28060)

9 days agopin GitHub Actions revisions from untrusted vendors
Dmitry Misharov [Thu, 27 Mar 2025 15:49:20 +0000 (16:49 +0100)] 
pin GitHub Actions revisions from untrusted vendors

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27181)

9 days agoUpdate container images in OS Zoo CI workflow
Dmitry Misharov [Wed, 16 Jul 2025 09:05:27 +0000 (11:05 +0200)] 
Update container images in OS Zoo CI workflow

Replace outdated and unsupported distro versions with up-to-date ones.

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

13 days agoevp_pkey_type: Make base_id_conversion table static
Norbert Pocs [Fri, 18 Jul 2025 06:55:18 +0000 (08:55 +0200)] 
evp_pkey_type: Make base_id_conversion table static

This commit fixes CI failures (when configured with --strict-warnings)

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28061)

13 days agoAdd AES-CFB128 optimizations with Intel AVX-512 and VAES
Stanciu, Adrian [Fri, 30 May 2025 16:17:26 +0000 (19:17 +0300)] 
Add AES-CFB128 optimizations with Intel AVX-512 and VAES

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

13 days agoExtract AES CFB implementation to cipher_aes_cfb*
Adrian Stanciu [Thu, 27 Feb 2025 08:59:36 +0000 (10:59 +0200)] 
Extract AES CFB implementation to cipher_aes_cfb*

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

13 days agoAdd workflow to check perl core modules for 5.10.1
Norbert Pocs [Thu, 10 Jul 2025 18:23:00 +0000 (20:23 +0200)] 
Add workflow to check perl core modules for 5.10.1

The motivation is to notice if we would add a module which is not a core
module in the minimal supported perl version.

This does not fail on other errors or warnings by perl, but we should
clear out those also.

Resolves: https://github.com/openssl/project/issues/1269

Signed-off-by: Norbert Pocs <norbertp@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/28024)

13 days agoDeprecate ASN1_METH related tests
Norbert Pocs [Tue, 17 Jun 2025 10:43:12 +0000 (12:43 +0200)] 
Deprecate ASN1_METH related tests

ASN1 tests had to be turned off, but the biggest change is the
ssl_test_ctx, where the NID resolution does not equal to the old one and
a little hack had to be used to make the test work.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

13 days agoDeprecate ASN1_METH internal usage
Norbert Pocs [Tue, 17 Jun 2025 10:47:54 +0000 (12:47 +0200)] 
Deprecate ASN1_METH internal usage

Some of them are needed and were kept by adding `#include
"internal/deprecated"` and some had to be turned off.

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

13 days agolibcrypto.num: Deprecate EVP_PKEY_ASN1_METHOD related functions
Norbert Pocs [Fri, 23 May 2025 10:08:39 +0000 (12:08 +0200)] 
libcrypto.num: Deprecate EVP_PKEY_ASN1_METHOD related functions

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

13 days agoUpdate documentation on EVP_PKEY_ASN1_METHOD deprecation
Norbert Pocs [Thu, 22 May 2025 10:23:56 +0000 (12:23 +0200)] 
Update documentation on EVP_PKEY_ASN1_METHOD deprecation

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

13 days agoDeprecate EVP_PKEY_ASN1_METHOD related function declarations and definitions
Norbert Pocs [Thu, 22 May 2025 10:01:19 +0000 (12:01 +0200)] 
Deprecate EVP_PKEY_ASN1_METHOD related function declarations and definitions

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

13 days agoAdd deprecation macros for 3.6.0
Norbert Pocs [Thu, 22 May 2025 09:45:49 +0000 (11:45 +0200)] 
Add deprecation macros for 3.6.0

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27727)

2 weeks agoproviders/implementations/digests/sha3_prov.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:31:42 +0000 (16:31 +0200)] 
providers/implementations/digests/sha3_prov.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/params.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:21:49 +0000 (16:21 +0200)] 
crypto/params.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/init.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:16:34 +0000 (16:16 +0200)] 
crypto/init.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/threads_pthread.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 14:11:39 +0000 (16:11 +0200)] 
crypto/threads_pthread.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/mem.c optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:58:52 +0000 (15:58 +0200)] 
crypto/mem.c optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/bn/bn_gf2m.c: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:53:31 +0000 (15:53 +0200)] 
crypto/bn/bn_gf2m.c: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agoinclude/crypto/md32_common.h: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 13:44:04 +0000 (15:44 +0200)] 
include/crypto/md32_common.h: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/bn/bn_lib.c: optimize - seems to bring not much benefit
Norbert Pocs [Thu, 3 Jul 2025 13:36:21 +0000 (15:36 +0200)] 
crypto/bn/bn_lib.c: optimize - seems to bring not much benefit

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agocrypto/evp/digest.c: optimize ossl_(un)likely
Norbert Pocs [Thu, 3 Jul 2025 10:04:52 +0000 (12:04 +0200)] 
crypto/evp/digest.c: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

2 weeks agoUpdate doc on CRYPTO_MEM_SEC(_MINSIZE)
Norbert Pocs [Mon, 14 Jul 2025 13:59:07 +0000 (15:59 +0200)] 
Update doc on CRYPTO_MEM_SEC(_MINSIZE)

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28036)

2 weeks agoopenssl: Add option to init sec mem at startup
Norbert Pocs [Mon, 14 Jul 2025 13:01:24 +0000 (15:01 +0200)] 
openssl: Add option to init sec mem at startup

Adding env variables OPENSSL_SEC_MEM and OPENSSL_SEC_MEM_MINSIZE, which
initializes the secure memory at the beginning of the openssl app.

Resolves: https://github.com/openssl/project/issues/786

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28036)

2 weeks agoLMS: Coverity Fix 1659010 (Unused Value)
slontis [Mon, 14 Jul 2025 01:06:10 +0000 (11:06 +1000)] 
LMS: Coverity Fix 1659010 (Unused Value)

This was a false positive in a test.
The code has been reordered to make the flow clearer.

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

2 weeks agoLMS Coverity fix 1659009
slontis [Mon, 14 Jul 2025 01:01:41 +0000 (11:01 +1000)] 
LMS Coverity fix 1659009

Fix deref after free.

If ctx->key is already set and the passed in key is NULL then ctx->key
should not be set to NULL.

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

2 weeks agoconst up ERR_str_libraries
Caolán McNamara [Sun, 13 Jul 2025 19:21:19 +0000 (20:21 +0100)] 
const up ERR_str_libraries

CLA: trivial

move this symbol out of the .data section

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

2 weeks agosec_mem: add note about the perf implications
Nikola Pajkovsky [Thu, 10 Jul 2025 07:03:38 +0000 (09:03 +0200)] 
sec_mem: add note about the perf implications

Testing secure storage for ml-kem/dsa [1] shows performace penalty
when secure storage is enabled.

| Threads | baseline usec/handshake | secmem usec/handshake |
|---------+-------------------------+-----------------------|
|       1 |              586.784756 |            588.306131 |
|       2 |              599.537648 |            601.007393 |
|       4 |              610.663361 |            613.600663 |
|       8 |              649.347376 |            869.693358 |
|      16 |             1176.402781 |           2487.335286 |
|      32 |             2345.594618 |           5155.747515 |
|      64 |             4697.556045 |          11170.627031 |

the test shows that sec mem is ok-ish up to the number of available cores,
and when the sec mem lock gets contended, performance goes down rapidly.
Tested on Apple M4 Pro.

[1] https://github.com/openssl/openssl/pull/27625

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28011)

2 weeks agoci: enable lms only on master
Nikola Pajkovsky [Fri, 11 Jul 2025 07:18:12 +0000 (09:18 +0200)] 
ci: enable lms only on master

a new config option cannot be enabled globally because the option
was not backported to the older versions.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28019)

2 weeks agoAdd lock contention checking to our pthreads implementation
Neil Horman [Tue, 24 Jun 2025 17:50:09 +0000 (13:50 -0400)] 
Add lock contention checking to our pthreads implementation

Something we're missing in our ability to do performance monitoring
and diagnosis in openssl is the ability to check for lock contention.
While some tools exist for this (valgrinds drd tool for example), they
really only measure the time spent in critical sections, not the
instances in which they are contended.  For that we need something more
specific.

This patch introduces the REPORT_RWLOCK_CONTENTION macro.  When openssl
is built with:
./Configure -rdynamic -fno-omit-frame-pointer -DREPORT_RWLOCK_CONTENTION

We can now get output sent to a log file that looks like the following:

===============
lock blocked on WRITE for 1001 usec
/lib64/libasan.so.8(+0x525e7) [0x7fc5ef4525e7]
../../test/quic_radix_test(CRYPTO_THREAD_write_lock+0x151) [0x79d976]
../../test/quic_radix_test() [0x61e6fb]
../../test/quic_radix_test(test_vprintf_stderr+0x15) [0x61e78d]
../../test/quic_radix_test(test_printf_stderr+0x10f) [0x623ba4]
../../test/quic_radix_test(test_fail_message_prefix+0xf7) [0x62436b]
../../test/quic_radix_test() [0x6243b9]
../../test/quic_radix_test(test_info+0x133) [0x624842]
../../test/quic_radix_test() [0x415aad]
../../test/quic_radix_test() [0x417bad]
../../test/quic_radix_test() [0x41b1a9]
../../test/quic_radix_test() [0x41b2eb]
../../test/quic_radix_test() [0x8071fc]
/lib64/libasan.so.8(+0x28ee6) [0x7fc5ef428ee6]
/lib64/libc.so.6(+0x711d4) [0x7fc5ef27f1d4]
/lib64/libc.so.6(+0xf3cec) [0x7fc5ef301cec]
==============

Which tells us when a thread blocked because someone else was already
holding the lock, how long it was blocked for, and where the blocking
call originated from via its backtrace.

I think this should enable us to better determine where our contended
locking paths are for a given application, and give us some insight on
how to fix them.

Currently its linux only (as the backtrace functionality only exists
there, and there are few warts (like the need to use a file pointer
rather than a bio to record the log, see comments), but I think its
enough to give us a useful diagnostic tool to help drive some
performance improvements.

Fixes openssl/project#1237

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27884)

2 weeks agoMake the lock in CRYPTO_secure_actual_size a read lock
Nikola Pajkovsky [Thu, 10 Jul 2025 07:48:15 +0000 (09:48 +0200)] 
Make the lock in CRYPTO_secure_actual_size a read lock

there is no operations within critical section that would
require write lock.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28014)

2 weeks agoAdd note about use of EVP_PKEY in different libctxs
Michael Baentsch [Mon, 30 Jun 2025 07:33:46 +0000 (09:33 +0200)] 
Add note about use of EVP_PKEY in different libctxs

Co-authored-by: Shane Lontis <slontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26309)

2 weeks agoPEM_read_CMS.pod: Correct the deprecation notice
Tomas Mraz [Fri, 20 Jun 2025 15:07:19 +0000 (17:07 +0200)] 
PEM_read_CMS.pod: Correct the deprecation notice

Fixes #27863

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

2 weeks agoProvide X509_CRL_get0_tbs_sigalg()
Theo Buehler [Sun, 6 Jul 2025 11:55:52 +0000 (13:55 +0200)] 
Provide X509_CRL_get0_tbs_sigalg()

X509_CRL_get0_tbs_sigalg() corresponds to X509_get0_tbs_sigalg() and
retrieves the AlgorithmIdentifier inside the TBSCertList which is not
currently accessible in any sane way from public API.

This PR adds X509_get0_tbs_sigalg() to the public API, documents it,
adds a simple regress check so there is coverage and mentions the
addition in CHANGES.md.

On top of that, fix a typo in .gitignore and clean up some order
inconsistencies in X509_get0_signature.pod.

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