2
0
mirror of https://github.com/openssl/openssl.git synced 2025-03-07 19:38:33 +08:00
Commit Graph

36158 Commits

Author SHA1 Message Date
Dr. David von Oheimb
ddae593a92 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)
2025-01-06 11:41:03 +01:00
Matt Caswell
563f6b6573 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)
2025-01-06 08:19:28 +00:00
Michael Baentsch
817a2b2b49 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)
2025-01-03 16:57:51 +01:00
Frederik Wedel-Heinen
65db21935a 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)
2025-01-03 15:58:26 +01:00
Jonathan M. Wilbur
40c55b5aa4 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)
2025-01-02 20:06:59 +01:00
Jonathan M. Wilbur
e3f82f2c56 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)
2025-01-02 20:06:59 +01:00
Jonathan M. Wilbur
9598bc15e9 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)
2025-01-02 20:06:59 +01:00
cx
0f6caf7409 Reject invalid FFDHE and ECDHE key shares with SSL_AD_ILLEGAL_PARAMETER alert
This changes the alert according to RFC 8446.

Fixes: 

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25547)
2025-01-02 14:12:54 +01:00
Niels Dossche
32476957ea 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)
2025-01-02 14:06:51 +01:00
Tomas Mraz
0baa3ac736 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)
2024-12-31 15:03:13 +01:00
Neil Horman
4f37e543d9 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)
2024-12-30 14:16:17 -05:00
Зишан Мирза
c93f4a1e75 ec_kem.c: Fix ikmlen check
This makes `ikmlen` have a length of at least `Nsk`.

Closes 

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)
2024-12-30 17:13:43 +01:00
Matt Caswell
0958f5a5bc 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)
2024-12-26 19:55:17 +01:00
Matt Caswell
2986908cc7 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 

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26256)
2024-12-26 19:55:17 +01:00
ryuishii
5b33d3e158 X509_ACERT_sign_ctx(): Remove superfluous reference
CLA: trivial

Fixes 

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26120)
2024-12-26 19:40:54 +01:00
Peter Juhasz
34ea176abf 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 

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15783)
2024-12-26 19:33:42 +01:00
Jonathan M. Wilbur
b85e6f5349 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)
2024-12-23 13:54:22 +00:00
Jonathan M. Wilbur
3974058a09 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)
2024-12-23 09:58:15 +00:00
Jonathan M. Wilbur
1e307e65ba 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)
2024-12-23 09:58:15 +00:00
Jonathan M. Wilbur
93b5275f6b 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)
2024-12-23 09:58:15 +00:00
Dmitry Belyavskiy
b3bb214720 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)
2024-12-20 18:20:17 +01:00
Dmitry Belyavskiy
f6097c7c5d This is a test for nocache provider behavior
A follow-up to 

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26197)
2024-12-20 18:20:17 +01:00
Andrey Tsygunka
bf2dea0e2c 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)
2024-12-20 09:47:34 +01:00
Kalavakolanu, Hema Anmisha
53b34561b5 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)
2024-12-19 17:45:48 +01:00
Tomas Mraz
009fa4f924 test_evp_cipher_pipeline(): Fix memory leaks on errors
Fixes Coverity 1636844, 1636845

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)
2024-12-19 10:59:53 +01:00
Patrick J. LoPresti
982a9b8bee doc: Correctly reflect parameter constraints in EVP_DecryptUpdate()
Fixes 

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)
2024-12-19 10:57:00 +01:00
Michael Baentsch
50ef944cd6 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)
2024-12-18 17:23:57 +01:00
Neil Horman
e0ea913f11 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)
2024-12-17 12:12:54 -05:00
otherddn1978
82e7a1130a 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)
2024-12-17 14:53:14 +01:00
Ramkumar
c44066bb4c 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)
2024-12-17 11:59:32 +00:00
Ramkumar
a055154607 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)
2024-12-17 11:59:32 +00:00
Ramkumar
ef7967d0b4 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)
2024-12-17 11:59:32 +00:00
Ramkumar
81af0b04cb 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)
2024-12-17 11:59:32 +00:00
Michael Baentsch
0f77b6f14e 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)
2024-12-16 11:02:08 +01:00
Tomas Mraz
79c9cbbe1f Fix breakage on arm64_32 platforms
We just avoid the special handling needed for Apple M1.

Fixes 

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)
2024-12-13 15:05:21 +01:00
Ryan Farley
ffa1cf69aa openssl-dgst: Document that xoflen is required for shake
With b911fef216, 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)
2024-12-13 14:54:18 +01:00
Elizarova, Alina
acc2655236 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)
2024-12-13 14:51:22 +01:00
Sasha Romijn
1b3b5a019a 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)
2024-12-13 11:38:10 +01:00
Neil Horman
005721e1a2 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)
2024-12-13 11:29:12 +01:00
Michael Baentsch
8cbe6e5a81 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)
2024-12-13 11:27:19 +01:00
Tomas Mraz
c5257fd8d0 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)
2024-12-13 08:30:18 +01:00
Dr. David von Oheimb
a82c2bf5c9 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)
2024-12-13 08:26:19 +01:00
Tomas Mraz
be4ce01f9f 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)
2024-12-13 08:23:21 +01:00
Dmitry Belyavskiy
8ad98cce41 To verify MAC, we need a MAC
Fixes 

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26140)
2024-12-11 18:27:54 +01:00
Jonathan M. Wilbur
fe89f308ae 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)
2024-12-11 18:26:37 +01:00
Jonathan M. Wilbur
29ab951e9c 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)
2024-12-11 18:26:37 +01:00
Jonathan M. Wilbur
70b17e5a00 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)
2024-12-11 18:26:37 +01:00
Shakti Shah
02e72ccffa dh_cms_set_peerkey(): Fix the incorrect condition
Only absent parameters allowed in RFC 3370.

Fixes 

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26058)
2024-12-11 18:03:34 +01:00
Tomas Mraz
d992e8729e 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)
2024-12-10 19:04:29 +01:00
Neil Horman
dc10ffc283 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)
2024-12-10 14:58:08 +01:00