]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
6 months agoFix originator cert leak in cms app
Jakub Zelenka [Fri, 13 Dec 2024 12:47:25 +0000 (13:47 +0100)] 
Fix originator cert leak in cms app

Reviewed-by: Hugo Landau <hlandau@devever.net>
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/26014)

6 months agoOptimize x86/aarch64 MD5 implementation
Jonathan Swinney [Fri, 18 Oct 2024 16:55:07 +0000 (11:55 -0500)] 
Optimize x86/aarch64 MD5 implementation

As suggested in https://github.com/animetosho/md5-optimisation?tab=readme-ov-file#dependency-shortcut-in-g-function,
we can delay the dependency on 'x' by recognizing that ((x & z) | (y & ~z))
is equivalent to ((x & z) + (y + ~z)) in this scenario, and we can perform
those additions independently, leaving our dependency on x to the final
addition. This speeds it up around 5% on both platforms.

Signed-off-by: Oli Gillespie <ogillesp@amazon.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
(Merged from https://github.com/openssl/openssl/pull/25737)

6 months agoopenssl-pkeyutl.pod.in: update from SHA-1 to SHA256, fixing default values and examples
Dr. David von Oheimb [Fri, 15 Nov 2024 07:49:33 +0000 (08:49 +0100)] 
openssl-pkeyutl.pod.in: update from SHA-1 to SHA256, fixing default values and examples

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25958)

6 months agoopenssl-pkeyutl.pod.in: various fixes
Dr. David von Oheimb [Thu, 14 Nov 2024 08:43:21 +0000 (09:43 +0100)] 
openssl-pkeyutl.pod.in: various fixes

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25958)

6 months agoapps/pkeyutl: Fix checks and documentation regarding -peerkey
Dr. David von Oheimb [Thu, 14 Nov 2024 08:28:16 +0000 (09:28 +0100)] 
apps/pkeyutl: Fix checks and documentation regarding -peerkey

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25958)

6 months agoAdd a funding.json file
Matt Caswell [Mon, 23 Dec 2024 11:25:02 +0000 (11:25 +0000)] 
Add a funding.json file

For details about this file format see:
https://floss.fund/funding-manifest/

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26247)

6 months agoCorrect return value documentation for X509V3_set_ctx()
Michael Baentsch [Wed, 1 Jan 2025 18:27:45 +0000 (19:27 +0100)] 
Correct return value documentation for X509V3_set_ctx()

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/26295)

6 months agoAvoid leaking memory when realloc fails
Frederik Wedel-Heinen [Sun, 22 Dec 2024 12:35:00 +0000 (13:35 +0100)] 
Avoid leaking memory when realloc fails

In ossl_property_merge() we can drop the realloc because it just makes
the allocation smaller.

In quic-hq-interop.c we check the realloc result.

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

6 months agotest: allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Fri, 13 Dec 2024 07:00:58 +0000 (07:00 +0000)] 
test: allowedAttributeAssignments X.509v3 extension

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

6 months agodoc: the allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 14:52:37 +0000 (14:52 +0000)] 
doc: the allowedAttributeAssignments X.509v3 extension

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

6 months agofeat: support the allowedAttributeAssignments X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 14:29:50 +0000 (14:29 +0000)] 
feat: support the allowedAttributeAssignments X.509v3 extension

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

6 months agoReject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert
cx [Thu, 26 Sep 2024 03:27:14 +0000 (11:27 +0800)] 
Reject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert

This changes the alert according to RFC 8446.

Fixes: #25402
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25547)

6 months agoFix potential memory leak in BIO_get_accept_socket()
Niels Dossche [Mon, 28 Oct 2024 15:34:55 +0000 (16:34 +0100)] 
Fix potential memory leak in BIO_get_accept_socket()

When BIO_parse_hostserv() fails it may still have allocated memory, yet
this memory is not freed. Fix it by jumping to the err label.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
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/25817)

7 months agocore_namemap.c: Use OPENSSL_STRING instead of defining STRING type
Tomas Mraz [Fri, 20 Dec 2024 16:20:04 +0000 (17:20 +0100)] 
core_namemap.c: Use OPENSSL_STRING instead of defining STRING type

Also avoid leak if stack push fails.

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

7 months agoReduce the matrix fanout of interop runner
Neil Horman [Fri, 27 Dec 2024 12:41:30 +0000 (07:41 -0500)] 
Reduce the matrix fanout of interop runner

Recent test additions have increased the number of jobs spawned by the
interop runner test which exceeds the maximum allowed.

This occurs because the matrix expands to:
7 server elements
6 client elements
7 tests
2 test steps (client interop and server interop

Because of how github ci does matrix expansion, this results in
2 * 7 * 7 * 6 = 588

But most of those are invalid because each of the 2 steps only considers
either the client or server elements, and so get rerun multiple times

Alter the steps to be individual jobs, each with their own reduced
matrix to only run each relevant test once, limiting our job count to
at most 49 jobs.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26275)

7 months agoec_kem.c: Fix ikmlen check
Зишан Мирза [Tue, 24 Dec 2024 06:05:21 +0000 (11:05 +0500)] 
ec_kem.c: Fix ikmlen check

This makes `ikmlen` have a length of at least `Nsk`.

Closes #26213

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26254)

7 months agoAdd a daily run-checker test for the TLS security level
Matt Caswell [Tue, 24 Dec 2024 09:34:27 +0000 (09:34 +0000)] 
Add a daily run-checker test for the TLS security level

Add a test to check that if the user reduces the default TLS security level
at configure time, then the tests still pass.

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

7 months agoEnsure the tests pass even if the default seclevel has been changed
Matt Caswell [Tue, 24 Dec 2024 09:29:07 +0000 (09:29 +0000)] 
Ensure the tests pass even if the default seclevel has been changed

The compile time default TLS security level can be changed if the user
sets `-DOPENSSL_TLS_SECURITY_LEVEL=x` at configure time (where "x" is some
number, typically 0 or 1).

Since OpenSSL 3.4 tests are failing if the default security level is 0. We
fix the tests for this case.

Fixes #26255

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

7 months agoX509_ACERT_sign_ctx(): Remove superfluous reference
ryuishii [Thu, 5 Dec 2024 06:48:51 +0000 (15:48 +0900)] 
X509_ACERT_sign_ctx(): Remove superfluous reference

CLA: trivial

Fixes #26107

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

7 months agoAdd CMS_NO_SIGNING_TIME flag to CMS_sign(), CMS_add1_signer()
Peter Juhasz [Tue, 15 Jun 2021 23:23:27 +0000 (01:23 +0200)] 
Add CMS_NO_SIGNING_TIME flag to CMS_sign(), CMS_add1_signer()

Previously there was no way to create a CMS SignedData signature without a
signing time attribute, because CMS_SignerInfo_sign added it unconditionally.
However, there is a use case (PAdES signatures) where this attribute is not
allowed, so this commit introduces a new flag to the CMS API that causes this
attribute to be omitted at signing time.

Also add -no_signing_time option to cms command.

Fixes #15777

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

7 months agofix: ci failures due to symbols missing from history
Jonathan M. Wilbur [Mon, 23 Dec 2024 13:24:21 +0000 (13:24 +0000)] 
fix: ci failures due to symbols missing from history

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

7 months agodoc: the attributeMappings X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 03:05:54 +0000 (03:05 +0000)] 
doc: the attributeMappings X.509v3 extension

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

7 months agotest: the attributeMappings X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 02:14:41 +0000 (02:14 +0000)] 
test: the attributeMappings X.509v3 extension

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

7 months agofeat: support the attributeMappings X.509v3 extension
Jonathan M. Wilbur [Thu, 12 Dec 2024 02:10:25 +0000 (02:10 +0000)] 
feat: support the attributeMappings X.509v3 extension

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

7 months agoTake into account no_store when pushing algorithm
Dmitry Belyavskiy [Wed, 18 Dec 2024 20:28:14 +0000 (21:28 +0100)] 
Take into account no_store when pushing algorithm

When we put algorithm to the store, we have a fallback to the
OSSL_LIB_CTX level store when store is NULL.

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

7 months agoThis is a test for nocache provider behavior
Dmitry Belyavskiy [Tue, 17 Dec 2024 15:18:37 +0000 (16:18 +0100)] 
This is a test for nocache provider behavior

A follow-up to #26038

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

7 months agoossl_i2c_ASN1_BIT_STRING(): Fix a possible heap buffer overflow
Andrey Tsygunka [Tue, 26 Nov 2024 07:53:31 +0000 (10:53 +0300)] 
ossl_i2c_ASN1_BIT_STRING(): Fix a possible heap buffer overflow

When data contains only zero values a buffer overflow happens.

CLA: trivial

Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26190)

7 months agosafe_math.h: Check if __GNUC__ is defined
Kalavakolanu, Hema Anmisha [Wed, 18 Dec 2024 05:19:55 +0000 (10:49 +0530)] 
safe_math.h: Check if __GNUC__ is defined

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4880

Facing the below issue after openssl is upgraded

Edk2\CryptoPkg\Library\OpensslLib\openssl\include\internal/safe_math.h(19):
warning C4668: '__GNUC__' is not defined as a preprocessor macro, replacing
with '0' for '#if/#elif'

CLA: trivial

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kalavakolanu Hema Anmisha <hema.anmisha.kalavakolanu@intel.com>
Reviewed-by: Paul Dale <ppzgs1@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/26204)

7 months agotest_evp_cipher_pipeline(): Fix memory leaks on errors
Tomas Mraz [Wed, 18 Dec 2024 08:21:10 +0000 (09:21 +0100)] 
test_evp_cipher_pipeline(): Fix memory leaks on errors

Fixes Coverity 16368441636845

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

7 months agodoc: Correctly reflect parameter constraints in EVP_DecryptUpdate()
Patrick J. LoPresti [Tue, 17 Dec 2024 23:46:04 +0000 (15:46 -0800)] 
doc: Correctly reflect parameter constraints in EVP_DecryptUpdate()

Fixes #26169

CLA: trivial

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

7 months agoFix missing HISTORY doc entries
Michael Baentsch [Mon, 16 Dec 2024 07:16:42 +0000 (08:16 +0100)] 
Fix missing HISTORY doc entries

Also add a check to find-doc-nits for HISTORY sections.

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

7 months agoAdd amplification limit test to interop quic testing
Neil Horman [Sat, 14 Dec 2024 20:56:22 +0000 (15:56 -0500)] 
Add amplification limit test to interop quic testing

Because this ci job only runs from the master branch, we need to add the
test here to validate that our server respects amplification limits in
our ci runs.

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

7 months agoCheck whether ctx->pctx != NULL
otherddn1978 [Fri, 13 Dec 2024 15:00:09 +0000 (18:00 +0300)] 
Check whether ctx->pctx != NULL

If it is NULL, ctx->pctx->pmeth dereference will cause a crash.

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

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26176)

7 months agodocs: update man3 and man7 with cipher pipeline APIs 26136/head
Ramkumar [Sun, 10 Nov 2024 17:50:04 +0000 (23:20 +0530)] 
docs: update man3 and man7 with cipher pipeline APIs

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

7 months agotest: add evp_extra_test case for cipher pipeline API with fake pipeline provider
Ramkumar [Sat, 31 Aug 2024 12:03:49 +0000 (17:33 +0530)] 
test: add evp_extra_test case for cipher pipeline API with fake pipeline provider

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

7 months agofeat: add EVP APIs for cipher pipelining
Ramkumar [Mon, 9 Sep 2024 06:58:28 +0000 (12:28 +0530)] 
feat: add EVP APIs for cipher pipelining

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

7 months agodocs: EVP pipeline API design document
Ramkumar [Wed, 7 Aug 2024 17:58:45 +0000 (23:28 +0530)] 
docs: EVP pipeline API design document

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

7 months agoUpdate HISTORY sections of libssl functions > 3.0.0
Michael Baentsch [Thu, 12 Dec 2024 08:01:55 +0000 (09:01 +0100)] 
Update HISTORY sections of libssl functions > 3.0.0

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

7 months agoFix breakage on arm64_32 platforms
Tomas Mraz [Tue, 10 Dec 2024 10:04:31 +0000 (11:04 +0100)] 
Fix breakage on arm64_32 platforms

We just avoid the special handling needed for Apple M1.

Fixes #26135

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

7 months agoopenssl-dgst: Document that xoflen is required for shake
Ryan Farley [Fri, 6 Dec 2024 12:21:45 +0000 (06:21 -0600)] 
openssl-dgst: Document that xoflen is required for shake

With b911fef216d1386210ec24e201d54d709528abb4, there is no longer a
default xoflen for shake algorithms. Update the manual to reflect this.

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

7 months agoExtension of OPENSSL_ia32cap to accommodate additional CPUID bits
Elizarova, Alina [Wed, 4 Dec 2024 18:29:23 +0000 (10:29 -0800)] 
Extension of OPENSSL_ia32cap to accommodate additional CPUID bits

bits 128 - 191 CPUID.(EAX=07H,ECX=0H).EDX and CPUID.(EAX=07H,ECX=1H).EAX
bits 192 - 255 CPUID.(EAX=07H,ECX=1H).EDX and CPUID.(EAX=07H,ECX=1H).EBX
bits 256 - 319 CPUID.(EAX=07H,ECX=1H).ECX and CPUID.(EAX=24H,ECX=0H).EBX

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

7 months agoFix typo in SSL_get_shared_sigalgs docs
Sasha Romijn [Wed, 11 Dec 2024 13:31:12 +0000 (14:31 +0100)] 
Fix typo in SSL_get_shared_sigalgs docs

psighash -> psignhash

CLA: trivial

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

7 months agoLimit tests with non-openssl clients
Neil Horman [Fri, 6 Dec 2024 20:16:49 +0000 (15:16 -0500)] 
Limit tests with non-openssl clients

Several quic interop implementations have a server implementation, but
not a client implementation.  Don't bother trying to run those

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

7 months agoAdd HISTORY to BIO_s_mem documentation
Michael Baentsch [Tue, 10 Dec 2024 13:35:22 +0000 (14:35 +0100)] 
Add HISTORY to BIO_s_mem documentation

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

7 months agoFix leak of a RAND_POOL in error condition
Tomas Mraz [Wed, 11 Dec 2024 15:34:25 +0000 (16:34 +0100)] 
Fix leak of a RAND_POOL in error condition

Fixes Coverity 1636676

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

7 months agoX509: document non-standard behavior checking EKU extensions in CA and TA certs
Dr. David von Oheimb [Mon, 9 Dec 2024 21:22:24 +0000 (22:22 +0100)] 
X509: document non-standard behavior checking EKU extensions in CA and TA certs

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

7 months agoFix the intermittent lhash_test failure on Windows
Tomas Mraz [Wed, 11 Dec 2024 14:40:40 +0000 (15:40 +0100)] 
Fix the intermittent lhash_test failure on Windows

We must set pending_delete before the actual deletion as another inserting
or deleting thread can pick up the delete callback before the
ossl_ht_write_unlock() call.

This can happen only if no read locks are pending and only on Windows where
we do not use the write mutex to get the callback list.

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

7 months agoTo verify MAC, we need a MAC
Dmitry Belyavskiy [Mon, 9 Dec 2024 18:05:33 +0000 (19:05 +0100)] 
To verify MAC, we need a MAC

Fixes #26106

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

7 months agotest: the timeSpecification X.509v3 extension
Jonathan M. Wilbur [Mon, 16 Sep 2024 23:39:01 +0000 (23:39 +0000)] 
test: the timeSpecification X.509v3 extension

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

7 months agodoc: the timeSpecification X.509v3 extension
Jonathan M. Wilbur [Mon, 16 Sep 2024 23:26:16 +0000 (23:26 +0000)] 
doc: the timeSpecification X.509v3 extension

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

7 months agofeat: support the timeSpecification X.509v3 extension
Jonathan M. Wilbur [Mon, 16 Sep 2024 22:50:14 +0000 (22:50 +0000)] 
feat: support the timeSpecification X.509v3 extension

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

7 months agodh_cms_set_peerkey(): Fix the incorrect condition
Shakti Shah [Mon, 25 Nov 2024 15:16:45 +0000 (20:46 +0530)] 
dh_cms_set_peerkey(): Fix the incorrect condition

Only absent parameters allowed in RFC 3370.

Fixes #25824

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

7 months agoAdd function to mix in an additional input into a RAND_POOL
Tomas Mraz [Fri, 6 Dec 2024 15:22:42 +0000 (16:22 +0100)] 
Add function to mix in an additional input into a RAND_POOL

It will be just xor-ed over the existing entropy
in the pool.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26128)

7 months agoFix potential use-after-free in REF_PRINT_COUNT
Neil Horman [Wed, 16 Oct 2024 18:34:08 +0000 (14:34 -0400)] 
Fix potential use-after-free in REF_PRINT_COUNT

We use REF_PRINT_COUNT to dump out the value of various reference
counters in our code

However, we commonly use this macro after an increment or decrement.  On
increment its fine, but on decrement its not, because the macro
dereferences the object holding the counter value, which may be freed by
another thread, as we've given up our ref count to it prior to using the
macro.

The rule is that we can't reference memory for an object once we've
released our reference, so lets fix this by altering REF_PRINT_COUNT to
accept the value returned by CRYPTO_[UP|DOWN]_REF instead.  The
eliminates the need to dereference the memory the object points to an
allows us to use the call after we release our reference count

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25664)

7 months agoFix memory ordering guarantees and TSAN errors
Tomas Mraz [Thu, 17 Oct 2024 09:25:17 +0000 (11:25 +0200)] 
Fix memory ordering guarantees and TSAN errors

If we had refcounted object allowing lockless writes
the relaxed semantics on DOWN_REF would allow scheduling
these writes after simultaneous release of the object by
another thread.

We do not have any such objects yet, but better to make
the refcount correct just in case we will have them
in future.

TSAN doesn't properly understand this so we use
even stronger acq_rel semantics if building with TSAN.

Fixes #25660

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25664)

7 months agoAdd test for releasing a shared EVP_PKEY across threads
Tomas Mraz [Thu, 10 Oct 2024 20:10:54 +0000 (22:10 +0200)] 
Add test for releasing a shared EVP_PKEY across threads

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25664)

7 months agoossl_cms_get1_crls_ex(): Avoid doublefree if CRL up ref fails
Tomas Mraz [Thu, 5 Dec 2024 08:29:08 +0000 (09:29 +0100)] 
ossl_cms_get1_crls_ex(): Avoid doublefree if CRL up ref fails

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/26100)

(cherry picked from commit ef0be53f90045d0a9f0d085a7a4289335f49ee41)

7 months agoRevert the behavior change of CMS_get1_certs() and CMS_get1_crls()
Tomas Mraz [Tue, 3 Dec 2024 11:40:01 +0000 (12:40 +0100)] 
Revert the behavior change of CMS_get1_certs() and CMS_get1_crls()

Fixes #26079

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/26100)

(cherry picked from commit afd36cbef8b3b7b00bd4bcdc33802d4cb39fdffa)

7 months agoRemove references to git.openssl.org from README.md
Tom Cosgrove [Thu, 5 Dec 2024 17:27:52 +0000 (17:27 +0000)] 
Remove references to git.openssl.org from README.md

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

7 months agospeed.c: Changed the declaration of aead_ivlen to a #define
Mohammed Alhabib [Wed, 4 Dec 2024 06:03:17 +0000 (09:03 +0300)] 
speed.c: Changed the declaration of aead_ivlen to a #define

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26109)

7 months agoExchange jitter and no-ct jobs between daily and on push CI
Tomas Mraz [Wed, 4 Dec 2024 10:20:08 +0000 (11:20 +0100)] 
Exchange jitter and no-ct jobs between daily and on push CI

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

7 months agojitter_generate(): Properly mix in the additional input
Tomas Mraz [Wed, 4 Dec 2024 10:00:11 +0000 (11:00 +0100)] 
jitter_generate(): Properly mix in the additional input

By adding the additional input directly to the pool
we were using just the additional input.

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

7 months agoA typo fix in a comment
willmafh [Thu, 5 Dec 2024 03:49:21 +0000 (11:49 +0800)] 
A typo fix in a comment

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoAdd spaces to make macros more clear
willmafh [Wed, 4 Dec 2024 12:59:40 +0000 (20:59 +0800)] 
Add spaces to make macros more clear

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoCode & comments changes to make them in consistent
willmafh [Wed, 4 Dec 2024 03:00:35 +0000 (11:00 +0800)] 
Code & comments changes to make them in consistent

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoone more empty line for code style consistency
willmafh [Tue, 3 Dec 2024 05:15:14 +0000 (13:15 +0800)] 
one more empty line for code style consistency

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoChange all one's complement to ones' complement for consistency
willmafh [Tue, 3 Dec 2024 05:13:39 +0000 (13:13 +0800)] 
Change all one's complement to ones' complement for consistency

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoBN_secure_new function indentation correction
willmafh [Tue, 3 Dec 2024 05:11:33 +0000 (13:11 +0800)] 
BN_secure_new function indentation correction

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoDelete redundant parentheses for code consistency
willmafh [Tue, 3 Dec 2024 05:08:55 +0000 (13:08 +0800)] 
Delete redundant parentheses for code consistency

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoDelete a redundant break
willmafh [Tue, 3 Dec 2024 05:06:46 +0000 (13:06 +0800)] 
Delete a redundant break

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

7 months agoRun interop tests on feature/quic-server branch
Neil Horman [Sun, 1 Dec 2024 21:11:28 +0000 (16:11 -0500)] 
Run interop tests on feature/quic-server branch

We currently run interop tests as a client only from the master branch.
While we are developing quic-server it would be beneficial to also get
interop test results from the quic-server branch run as both a client
and a server, until such time as the feature branch is merged.  Add
building and running of a container in the test harness to our CI set

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

7 months agoAdd handling for additional input in jitter rng
jsondevers [Thu, 28 Nov 2024 16:49:23 +0000 (11:49 -0500)] 
Add handling for additional input in jitter rng

Fixes #25917

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25966)

7 months agofips: zeroization of ECX public keys
Joachim Vandersmissen [Sun, 27 Oct 2024 04:48:55 +0000 (23:48 -0500)] 
fips: zeroization of ECX public keys

Commit fa338aa7cd added zeroization of public security parameters as
required by ISO 19790:2012/Cor.1:2015 7.9. However, that commit
overlooked ECX keys, which are used for EdDSA and X25519/X448.

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

7 months agoproviders: stop probing for getentropy(3) on recent FreeBSD
Kyle Evans [Tue, 16 Jul 2024 05:21:58 +0000 (00:21 -0500)] 
providers: stop probing for getentropy(3) on recent FreeBSD

FreeBSD has supported both getrandom(2) and getentropy(3) since 12.0.
The last version which did *not* have these went EoL in September 2021.
Use getrandom(2) unconditionally and fallback to sysctl kern.arandom if
we do happen to have a FreeBSD that old.

This is generally a necessary step for FreeBSD's _FORTIFY_SOURCE
implementation, which needs to do some symbol renaming tricks with the
getentropy declaration that would otherwise add some platform-specific
hacks here to accommodate.  getentropy(3) uses getrandom(2) internally
on FreeBSD, so we just cut out the middleman.

While we're here, it doesn't seem to make sense to ever prefer the
sysctl on FreeBSD or NetBSD.  For both platforms, it's limited to 256
bytes in a single request while getrandom(2) will generally use the same
backend but service the entire request in one shot, even for larger
amounts of entropy, modulo the EINTR possibility that presents itself
with larger requests.

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

7 months agofips-label.yml: Fix ABI change label removal
Tomas Mraz [Thu, 28 Nov 2024 15:58:06 +0000 (16:58 +0100)] 
fips-label.yml: Fix ABI change label removal

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

7 months agoAvoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE
Tomas Mraz [Thu, 28 Nov 2024 09:10:28 +0000 (10:10 +0100)] 
Avoid NULL dereference with PKCS7_OP_SET_DETACHED_SIGNATURE

We would dereference p7->d.sign pointer which can be NULL.

Reported by Han Zheng.

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

8 months agoDocument version-specific utility of EVP_PKEY_Q_keygen
Michael Baentsch [Sat, 23 Nov 2024 05:44:40 +0000 (06:44 +0100)] 
Document version-specific utility of EVP_PKEY_Q_keygen

Reviewed-by: Matt Caswell <matt@openssl.org>
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/26040)

8 months agoMinor nit fix to EVP_CipherFinal_ex() return code documentation.
Frederik Wedel-Heinen [Fri, 1 Nov 2024 13:18:38 +0000 (14:18 +0100)] 
Minor nit fix to EVP_CipherFinal_ex() return code documentation.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25849)

8 months agoFix memleak in dsa_gen()
Holger Dengler [Thu, 14 Nov 2024 08:55:50 +0000 (09:55 +0100)] 
Fix memleak in dsa_gen()

Free the stack return value `dsa` on each early exit.

Fixes #25905

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25948)

8 months agoFix EVP_PKEY_print_private() so that it works with non default providers.
slontis [Wed, 20 Nov 2024 01:39:35 +0000 (12:39 +1100)] 
Fix EVP_PKEY_print_private() so that it works with non default providers.

At some point in time it was decided that the EC keymanagers ec_export()
function would only allow the selection to be both the public + private
parts. If just the private element is selected it returns an error.
Many openssl commandline apps use EVP_PKEY_print_private() which passes
EVP_PKEY_PRIVATE_KEY to the encoder. This selection propagates to
encoder_construct_pkey(). For external providers (such as the fips
provider this will call the keymanagers export() with the selection set
to just the private part.

So we either need to
1) change the selection in EVP_PKEY_print_private() or
2) modify the selection used in the export used in
   encoder_construct_pkey
3) Change the ec_export to allow this.

I have chosen 2) but I am not sure if this is the correct thing to do
or whether it should conditionally do this when the output_type ==
'text'.

Issue was reported by Ilia Okomin (Oracle).

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

8 months agodie() in .tmpl file should not be silently ignored.
Alexandr Nedvedicky [Tue, 26 Nov 2024 08:05:09 +0000 (09:05 +0100)] 
die() in .tmpl file should not be silently ignored.

call to die() in perl templates is currently ignored.
any error printed by die() commad appears in template
output.

In order to make sure die() terminates processing we
must ensure we emite `undef` value. This is ensured
by adding a `BROKEN` callback to `fill_in()` Template
method. The callback must return undef to stop processing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26064)

8 months agoapps/passwd.c: Convert a redundant check to assert
Bartel Artem [Mon, 25 Nov 2024 11:28:05 +0000 (14:28 +0300)] 
apps/passwd.c: Convert a redundant check to assert

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26053)

8 months agoFix solaris build in CRYPTO_atomic_store api
Neil Horman [Wed, 27 Nov 2024 17:22:19 +0000 (12:22 -0500)] 
Fix solaris build in CRYPTO_atomic_store api

Misnamed variable, just correct it to dst

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

8 months agoUse static array (length 256) for copy of OPENSSL_MALLOC_FAILURES
sftcd [Mon, 25 Nov 2024 16:01:39 +0000 (16:01 +0000)] 
Use static array (length 256) for copy of OPENSSL_MALLOC_FAILURES

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26039)

8 months agoDeprecate all BIO_meth_get_*() functions
Tomas Mraz [Mon, 25 Nov 2024 15:06:47 +0000 (16:06 +0100)] 
Deprecate all BIO_meth_get_*() functions

Their use by applications is inherently unsafe.
Fixes #26047

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26056)

8 months agoUse sk_X509_ATTRIBUTE_deep_copy() to copy attribute stacks in pk7_doit.c
Niels Dossche [Wed, 16 Oct 2024 18:37:29 +0000 (20:37 +0200)] 
Use sk_X509_ATTRIBUTE_deep_copy() to copy attribute stacks in pk7_doit.c

Clean up the code by using the dedicated stack copy function.

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25713)

8 months agoci: add daily runcheckers to exercise the -DOPENSSL_PEDANTIC_ZEROIZATION option
Pauli [Wed, 27 Nov 2024 00:24:29 +0000 (11:24 +1100)] 
ci: add daily runcheckers to exercise the -DOPENSSL_PEDANTIC_ZEROIZATION option

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agofips: change integrity check zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION...
Pauli [Wed, 27 Nov 2024 00:21:08 +0000 (11:21 +1100)] 
fips: change integrity check zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agopbkdf2: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:32 +0000 (11:19 +1100)] 
pbkdf2: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agohkdf: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:19 +0000 (11:19 +1100)] 
hkdf: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agorsa: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:19:00 +0000 (11:19 +1100)] 
rsa: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoffc: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:18:51 +0000 (11:18 +1100)] 
ffc: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoec: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define
Pauli [Wed, 27 Nov 2024 00:18:38 +0000 (11:18 +1100)] 
ec: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26068)

8 months agoA typo fix in a comment
willmafh [Wed, 27 Nov 2024 03:06:36 +0000 (11:06 +0800)] 
A typo fix in a comment

CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26069)

8 months agoDocument expected BIO operations for libssl
David Benjamin [Mon, 25 Nov 2024 16:01:17 +0000 (11:01 -0500)] 
Document expected BIO operations for libssl

If your custom BIO does not implement BIO_CTRL_FLUSH, it won't work, but
this is not document anywhere.

Reviewed-by: Matt Caswell <matt@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/26060)

8 months agoUpgrade action/{upload,download}-artifact to v4
Richard Levitte [Mon, 11 Nov 2024 10:44:56 +0000 (11:44 +0100)] 
Upgrade action/{upload,download}-artifact to v4

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25920)

8 months agofips-jitter: set provider into error state upon CRNG permanent failures
Dimitri John Ledkov [Fri, 15 Nov 2024 05:32:33 +0000 (05:32 +0000)] 
fips-jitter: set provider into error state upon CRNG permanent failures

With fips-jitter build time option, jitter can be inside FIPS
boundary.

Calls to jent_read_entropy() can return permanent failures for
Repetitive Count Test (RTC), Adaptive Proportion Test (APT), LAG
prediction test.

Ensure the module enters error state upon permanent jitter failures.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25957)

8 months agoFix potential memory leak on failure of ecx_gen_init()
Niels Dossche [Wed, 20 Nov 2024 18:57:38 +0000 (19:57 +0100)] 
Fix potential memory leak on failure of ecx_gen_init()

When ecx_gen_set_params() returns 0, it could have duplicated the memory
for the parameter OSSL_KDF_PARAM_PROPERTIES already in gctx->propq,
leading to a memory leak.

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

8 months agoFix potential memory leak on failure of dsa_gen_init()
Niels Dossche [Wed, 20 Nov 2024 19:22:43 +0000 (20:22 +0100)] 
Fix potential memory leak on failure of dsa_gen_init()

When dsa_gen_set_params()  returns 0, it could have duplicated the memory for the parameter
OSSL_PKEY_PARAM_FFC_DIGEST already in gctx->mdname, leading to a memory leak.

Allocated here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L524
Can return 0 here: https://github.com/openssl/openssl/blob/47a80fd2034cd4314d3b4958539dcd3106087109/providers/implementations/keymgmt/dsa_kmgmt.c#L529-L536

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26016)

8 months agoEnable AES and SHA3 optimisations on Apple Silicon M4-based macOS systems
Tom Cosgrove [Tue, 12 Nov 2024 08:27:27 +0000 (08:27 +0000)] 
Enable AES and SHA3 optimisations on Apple Silicon M4-based macOS systems

AES gets a performance enhancement of 7-33%.

Tested on an M4 Pro, but the CPU cores are the same on M4 and M4 Max.

Change-Id: I634c03f1d2b50fa5f8ca97dd65975e49d970c72b

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/25940)