]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
6 months agoFinishing touch to perlasm update to make it work on OpenBSD
sashan [Mon, 29 Apr 2024 12:04:56 +0000 (14:04 +0200)] 
Finishing touch to perlasm update to make it work on OpenBSD

This changeset brings a finishing touch to stuff we got from botovoq@
Changes to `crypto/perlasm/arm-xlate.pl` deal with verious assembler
flavours to keep various assembler compilers happy.

We also need to keep original code for 32-bit flavour in
`crypto/aes/asm/aesv8-armx.pl`.

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

6 months agoMake it able to run asm code on OpenBSD (arm64)
Theo Buehler [Sun, 14 Apr 2024 23:23:36 +0000 (01:23 +0200)] 
Make it able to run asm code on OpenBSD (arm64)

In order to get asm code running on OpenBSD we must place
all constants into .rodata sections.

The change to crypto/perlasm/arm-xlate.pl adjusts changes
from Theo for additional assembler variants/flavours we
use for building OpenSSL.

Fixes #23312

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

6 months agodrbg: provide requested amount of entropy, rather than self-strength
Dimitri John Ledkov [Fri, 1 Nov 2024 14:16:18 +0000 (14:16 +0000)] 
drbg: provide requested amount of entropy, rather than self-strength

Parent DRBG can be seed source (os or jitter) and thus able to provide
unlimited entropy.

get_entropy is documented to provide at least the request amount of
entropy. If requested amount of entropy is same as, or less than
drbg->strength, everything is compliant. However, if requested entropy
is more than drbg->strength (unlikely, but possible), the returned
amount of entropy will be insufficient and additional repeated calls
to get_entropy will be required.

Reading history of refactors, it seems to me that this function call
previouslly had assumptions and usecases that couldn't ever request or
require more than strength amount of entropy.

If entropy is set, request that amount, otherwise request
drbg->strength amount.

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25850)

6 months agoFix obvious misspelling of ASN1_VALUE
Tom Cosgrove [Tue, 10 Dec 2024 11:31:11 +0000 (11:31 +0000)] 
Fix obvious misspelling of ASN1_VALUE

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

6 months agoFix double 'the's
Tom Cosgrove [Thu, 5 Dec 2024 09:08:42 +0000 (09:08 +0000)] 
Fix double 'the's

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

6 months agoLoongArch: we should access global symbol by la.global instead of
Wang Xin [Wed, 8 Jan 2025 01:18:47 +0000 (01:18 +0000)] 
LoongArch: we should access global symbol by la.global instead of
la.pcrel

openssl will not be built successfully with binutils-2.43.50.20241230
which checks if global symbols are accessed by PC-relative in shared
library.

CLA: trivial

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

6 months agoFix premature reuse of qp's in rcu locks
Neil Horman [Fri, 10 Jan 2025 19:37:28 +0000 (14:37 -0500)] 
Fix premature reuse of qp's in rcu locks

An intermittent failure was noted on our new ppc64le CI runner, in which
what appeared to be a corrupted or invalid value getting returned from a
shared pointer under rcu protection

Investigation showed that the problem was with our small number of qp's
in a lock, and slightly incorrect accounting of the number of qp's
available we were prematurely recycling qp's, which led in turn to
premature completion of synchronization states, resulting in readers
reading memory that may have already been freed.

Fix it by:
a) Ensuring that we account for the fact that the first qp in an rcu
lock is allocated at the time the lock is created

and

b) Ensuring that we have a minimum number of 3 qp's:
1 that is free for write side allocation
1 that is in use by the write side currently
1 "next" qp that the read side can update while the prior qp is being
retired

With this change, the rcu threadstest runs indefinately in my testing

Fixes #26356

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

6 months agoFix intermittent test failure in 80-test_cmp_http.t
Bernd Edlinger [Thu, 9 Jan 2025 14:14:15 +0000 (15:14 +0100)] 
Fix intermittent test failure in 80-test_cmp_http.t

output to stderr is unbuffered bypassing the normal output, which does
not happen at line boundaries and is therefore confusing the TAP parser.
This is known to cause random test failures like this one:

80-test_cmp_http.t                    (Wstat: 0 Tests: 5 Failed: 0)
  Parse errors: Tests out of sequence.  Found (6) but expected (5)
                Bad plan.  You planned 6 tests but ran 5.

Fixes #23992

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

6 months agocoveralls.yml: Avoid excluding subdirectories of already excluded dirs
Tomas Mraz [Mon, 13 Jan 2025 13:24:22 +0000 (14:24 +0100)] 
coveralls.yml: Avoid excluding subdirectories of already excluded dirs

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

6 months agospeed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers
Ingo Franzki [Wed, 8 Jan 2025 15:00:33 +0000 (16:00 +0100)] 
speed: Pass IV to EVP_CipherInit_ex for -evp runs with non-AEAD ciphers

Some (non-AEAD) ciphers require an IV to be used. Always pass a (dummy) IV
when setting the key. It is ignored by ciphers that do not use an IV.

Commit 607a46d003f472d4bce646f3df6e85725094d68a corrected the use of AEAD
ciphers, but removed the IV from being passed to EVP_CipherInit_ex() for
non-AEAD ciphers.

Fixes: https://github.com/openssl/openssl/commit/607a46d003f472d4bce646f3df6e85725094d68a
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26346)

6 months agoTweak case of [fs] variant letter in SLH-DSA algorithms
Viktor Dukhovni [Thu, 9 Jan 2025 13:09:09 +0000 (00:09 +1100)] 
Tweak case of [fs] variant letter in SLH-DSA algorithms

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

6 months agocoveralls.yml: Add --ignore-errors mismatch
Tomas Mraz [Fri, 10 Jan 2025 15:10:46 +0000 (16:10 +0100)] 
coveralls.yml: Add --ignore-errors mismatch

Once lcov is updated to 2.2 version or later, it could be dropped.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26381)

6 months agoPre-ML-KEM/DSA decoder/encoder refactor
Viktor Dukhovni [Thu, 9 Jan 2025 03:33:18 +0000 (14:33 +1100)] 
Pre-ML-KEM/DSA decoder/encoder refactor

Simplify some decoder/encoder internals to facilitate upcoming support
for ML-KEM and ML-DSA.

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

6 months agoFix buildinf.h generation for space and backslash
Kai Pastor [Sat, 4 Jan 2025 10:48:26 +0000 (11:48 +0100)] 
Fix buildinf.h generation for space and backslash

Builds may be configured with CC or CFLAGS containing space and
double quotes. In particular on Windows, this may lead to passing
more than two arguments into mkbuildinf.pl.
In addition, backslashes must be escaped for constructing the C string.

Fixes #26253.

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

6 months agoUpdate error codes in "crypto/err/openssl.txt"
Michael Baentsch [Tue, 7 Jan 2025 09:30:56 +0000 (10:30 +0100)] 
Update error codes in "crypto/err/openssl.txt"

Fixes #26316

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

6 months agoReplace self-hosted runners with GitHub hosted
Dmitry Misharov [Thu, 2 Jan 2025 14:32:41 +0000 (15:32 +0100)] 
Replace self-hosted runners with GitHub hosted

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

6 months agoFix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()
Frederik Wedel-Heinen [Sat, 21 Dec 2024 20:15:36 +0000 (21:15 +0100)] 
Fix memory leaks from missing checks of return value from sk_OPENSSL_STRING_push()

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

6 months agoFix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY
Richard Levitte [Wed, 8 Jan 2025 09:15:02 +0000 (10:15 +0100)] 
Fix the use of OPENSSL_HTTP_PROXY / OPENSSL_HTTPS_PROXY

Fixes #26337

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

6 months agoFix encryption level ordering
Neil Horman [Tue, 7 Jan 2025 14:12:03 +0000 (09:12 -0500)] 
Fix encryption level ordering

It was noticed recently that the enum for QUIC encryption levels doesn't
match the ordering that is outlined in the RFC.  RFC 9000 s. 12.2 and
RFC 9002 s 14.4.1 indicate that encryption level ordering is
INITIAL/0RTT/HANDSHAKE/1RTT, but our enum is in the order
INITAL/HANDSHAKE/0RTT/1RTT.

Our enum isn't a direct wire translation, so as long as the wire->enum
mapping done in ossl_quic_pkt_type_to_enc_level is done consistently it
ideally wouldn't matter, but because we do coalescing in
ossl_quic_tx_packetiser_generate by iterating through all the values in
the enum, its possible we may coalesce in the wrong order when we do
start implementing 0RTT support.

Fix it by adjusting the enum properly to match the RFC order.  This also
necessitates and adjustment to the archetypes array, which is a two
dimensional array indexed by encryption level and frame archetype
(PROBE/NORMAL/ACK ONLY).  Moving the 0RTT enc level to index 1 requires
moving the (formerly) index 2 0RTT array row to be at index 1.

Fixes #26324

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

6 months agoFree data if sk_OPENSSL_STRING_push fails.
Frederik Wedel-Heinen [Fri, 20 Dec 2024 14:45:53 +0000 (15:45 +0100)] 
Free data if sk_OPENSSL_STRING_push fails.

Fixes #26203

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

6 months agoReturn NULL from ossl_lib_ctx_get_concrete() when it is uninitialized
Frederik Wedel-Heinen [Sun, 5 Jan 2025 19:42:51 +0000 (20:42 +0100)] 
Return NULL from ossl_lib_ctx_get_concrete() when it is uninitialized

When default_context_inited is set to false we return NULL instead of
the global default context.

Fixes #25442

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

6 months agoAdded configuration for Embarcadero-Borland Clang Compiler 64 (BCC64)
Семенов Герман [Tue, 26 Mar 2024 11:06:57 +0000 (14:06 +0300)] 
Added configuration for Embarcadero-Borland Clang Compiler 64 (BCC64)

Signed-off-by: Герман Семенов <GermanAizek@yandex.ru>
Signed-off-by: Herman Semenov <GermanAizek@yandex.ru>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23377)

6 months agoCheck returns of various sk_*_push functions
Frederik Wedel-Heinen [Sat, 21 Dec 2024 14:15:11 +0000 (15:15 +0100)] 
Check returns of various sk_*_push functions

Check returns of sk_POLICY_MAPPING_push, sk_GENERAL_NAME_push,
sk_ACCESS_DESCRIPTION_push, sk_X509_push, sk_X509_NAME_push,
sk_OPENSSL_CSTRING_push, sk_SCT_push, sk_DIST_POINT_push,
sk_OSSL_CMP_CRLSTATUS_push, sk_ASN1_UTF8STRING_push and
sk_ASN1_OBJECT_push and handle appropriately.

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

6 months agoPass functions with correct signatures to the evp_generic_fetch_xxx methods
Frederik Wedel-Heinen [Sat, 4 Jan 2025 18:27:37 +0000 (19:27 +0100)] 
Pass functions with correct signatures to the evp_generic_fetch_xxx methods

UBSan complains about functions being called with incorrect signatures.
Relates to #22896

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

6 months agoFix a funding.json error
Matt Caswell [Mon, 6 Jan 2025 15:28:27 +0000 (15:28 +0000)] 
Fix a funding.json error

"Active" should be "active"

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26327)

6 months agoSome PQ-related CSOR OIDs
Viktor Dukhovni [Mon, 6 Jan 2025 04:04:58 +0000 (15:04 +1100)] 
Some PQ-related CSOR OIDs

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

6 months agoFix potential memory leak in PKCS12_add_key_ex()
Niels Dossche [Mon, 28 Oct 2024 16:04:03 +0000 (17:04 +0100)] 
Fix potential memory leak in PKCS12_add_key_ex()

p8 is allocated using EVP_PKEY2PKCS8(), but when PKCS8_add_keyusage()
fails this memory is not freed. Fix this by adding a call to
PKCS8_PRIV_KEY_INFO_free().

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25818)

6 months agoFix a potential misaligned memory access
Bernd Edlinger [Thu, 2 Jan 2025 15:17:46 +0000 (16:17 +0100)] 
Fix a potential misaligned memory access

in test/wpackettest.c:593:18: runtime error: load of misaligned address
for type 'uint64_t', which requires 8 byte alignment.

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

6 months agoFix the sporadic test failure in 30-test_evp_extra.t
Bernd Edlinger [Sun, 29 Dec 2024 15:43:34 +0000 (16:43 +0100)] 
Fix the sporadic test failure in 30-test_evp_extra.t

Fixes #26276

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

6 months agoRun fuzz-checker workflow on ubuntu-24.04
Bernd Edlinger [Thu, 26 Dec 2024 15:30:16 +0000 (16:30 +0100)] 
Run fuzz-checker workflow on ubuntu-24.04

Fix missing afl++-clang package
Use clang-18
Configure ubsan with -fno-sanitize=function

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

6 months agoFix test failure in 90-test_memleak.t
Bernd Edlinger [Fri, 27 Dec 2024 22:02:47 +0000 (23:02 +0100)] 
Fix test failure in 90-test_memleak.t

recent gcc versions can optimize the memory leak away,
avoid that by declaring the lost variable to be volatile.

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

6 months agouse-of-uninitialized-value in quic_tserver_test
Bernd Edlinger [Fri, 27 Dec 2024 12:56:06 +0000 (13:56 +0100)] 
use-of-uninitialized-value in quic_tserver_test

Fixes #26277

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

6 months agoFix a minor memory sanitizer issue
Bernd Edlinger [Thu, 26 Dec 2024 10:56:17 +0000 (11:56 +0100)] 
Fix a minor memory sanitizer issue

Here the undefined value "npa" passed to a function
WPACKET_sub_memcpy_u16(pkt, npa, npalen).
However the value is not really used, because "npalen" is zero,
but the call statememt itself is considered an invalid operation
by the new sanitizer.

The original sanitizer error report was:

==49175==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55a276b29d6f in tls_construct_stoc_next_proto_neg /home/runner/work/openssl/openssl/ssl/statem/extensions_srvr.c:1518:21
    #1 0x55a276b15d7d in tls_construct_extensions /home/runner/work/openssl/openssl/ssl/statem/extensions.c:909:15
    #2 0x55a276b513dc in tls_construct_server_hello /home/runner/work/openssl/openssl/ssl/statem/statem_srvr.c:2471:10
    #3 0x55a276b2e160 in write_state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:896:26
    #4 0x55a276b2e160 in state_machine /home/runner/work/openssl/openssl/ssl/statem/statem.c:490:21
    #5 0x55a276b2f562 in ossl_statem_accept /home/runner/work/openssl/openssl/ssl/statem/statem.c:309:12
    #6 0x55a276a9f867 in SSL_do_handshake /home/runner/work/openssl/openssl/ssl/ssl_lib.c:4890:19
    #7 0x55a276a9f605 in SSL_accept /home/runner/work/openssl/openssl/ssl/ssl_lib.c:2169:12
    #8 0x55a276a3d4db in create_bare_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1281:24
    #9 0x55a276a3d7cb in create_ssl_connection /home/runner/work/openssl/openssl/test/helpers/ssltestlib.c:1350:10
    #10 0x55a276a64c0b in test_npn /home/runner/work/openssl/openssl/test/sslapitest.c:12266:14
    #11 0x55a276b9fc20 in run_tests /home/runner/work/openssl/openssl/test/testutil/driver.c:377:21
    #12 0x55a276ba0b10 in main /home/runner/work/openssl/openssl/test/testutil/main.c:31:15

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

6 months agoTry to work around the llvm-symbolizer failure
Bernd Edlinger [Fri, 27 Dec 2024 07:49:13 +0000 (08:49 +0100)] 
Try to work around the llvm-symbolizer failure

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

6 months agoAdd __isoc23_strtol to unix-symbols.txt
Bernd Edlinger [Thu, 26 Dec 2024 20:02:58 +0000 (21:02 +0100)] 
Add __isoc23_strtol to unix-symbols.txt

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

6 months agoAdd -fno-sanitize=function to ubsan
Bernd Edlinger [Wed, 16 Oct 2024 14:37:32 +0000 (16:37 +0200)] 
Add -fno-sanitize=function to ubsan

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

6 months agoAdd linux ppc64le runner
Dmitry Misharov [Fri, 3 Jan 2025 14:56:23 +0000 (15:56 +0100)] 
Add linux ppc64le runner

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

6 months agoClean up ASN1_STRING comment and improve example in docs
Job Snijders [Tue, 17 Dec 2024 13:05:49 +0000 (13:05 +0000)] 
Clean up ASN1_STRING comment and improve example in docs

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

6 months agoadd multiplexing test for quic server to ci
Neil Horman [Tue, 17 Dec 2024 17:08:15 +0000 (12:08 -0500)] 
add multiplexing test for quic server to ci

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

6 months ago80-test_cms.t: Fix incorrect plan from bad merge
Tomas Mraz [Mon, 6 Jan 2025 12:03:59 +0000 (13:03 +0100)] 
80-test_cms.t: Fix incorrect plan from bad merge

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26322)

6 months agoFix CMS encryption with key agreement when originator set
Jakub Zelenka [Fri, 13 Dec 2024 12:48:23 +0000 (13:48 +0100)] 
Fix CMS encryption with key agreement when originator set

OpenSSL currently does not support encryption with originator flag so it
should fail nicely instead of segfaulting.

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

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

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

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

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

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

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

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