]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
2 months agoDrop empty app data records in DTLS
Matt Caswell [Tue, 29 Apr 2025 13:21:49 +0000 (14:21 +0100)] 
Drop empty app data records in DTLS

App data records with 0 bytes of payload will confuse callers of SSL_read().
This will cause a successful read and return 0 bytes as read. Unfortunately
a 0 return from SSL_read() is considered a failure response. A subsequent
call to SSL_get_error() will then give the wrong result.

Zero length app data records are actually allowed by the spec, but have
never been handled correctly by OpenSSL. We already disallow creating such
empty app data records. Since the SSL_read() API does not have a good way to
handle this type of read, we simply ignore them.

Partial fix for #27316

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27541)

(cherry picked from commit a23d5e20f162564d8c13bda50ea358caaa7b047c)

2 months agocrypto/provider_conf.c: Fix possible memory leak
JiashengJiang [Mon, 5 May 2025 01:41:39 +0000 (21:41 -0400)] 
crypto/provider_conf.c: Fix possible memory leak

Assign the return value of ossl_provider_info_add_to_store to added instead of
setting it directly to 1, in order to avoid a memory leak caused by entry not
being freed if ossl_provider_info_add_to_store() fails.

Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27472)

(cherry picked from commit 9884f1dc11675a5c4613339cfb92903c6ba6103f)

2 months agoFix SSL_{set1,add1}_host() handling of host name/IP address and related documentation
Dr. David von Oheimb [Mon, 21 Apr 2025 13:11:01 +0000 (15:11 +0200)] 
Fix SSL_{set1,add1}_host() handling of host name/IP address and related documentation

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

(cherry picked from commit 1eee02d3e710e01d864c37708f64e83511627e28)

2 months agoSSL_set1_host.pod: add recommendation to use SSL_{set1,add1}_host() and SSL_set_tlsex...
Dr. David von Oheimb [Mon, 21 Apr 2025 14:00:39 +0000 (16:00 +0200)] 
SSL_set1_host.pod: add recommendation to use SSL_{set1,add1}_host() and SSL_set_tlsext_host_name()

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

(cherry picked from commit eb909d785f89c5f92613865ed8e7afc9f6fb9b2c)

3 months agoFix use after free bugs for public_keys and private_keys in evp_test
Tobias Brick [Thu, 17 Apr 2025 14:50:36 +0000 (14:50 +0000)] 
Fix use after free bugs for public_keys and private_keys in evp_test

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

(cherry picked from commit 81e8b5a5038b4952a22b2dc9fcf9994615ee8dc4)

3 months agoFix test/recipes/25-test_verify.t [3.5]
Richard Levitte [Sun, 4 May 2025 07:17:52 +0000 (09:17 +0200)] 
Fix test/recipes/25-test_verify.t [3.5]

This removes a couple of tests that check a relaxation of the
'file:' scheme implementation that isn't present in OpenSSL 3.5

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

3 months agoDrop "by store"'s by_store_subject_ex()
Richard Levitte [Wed, 30 Apr 2025 12:37:12 +0000 (14:37 +0200)] 
Drop "by store"'s by_store_subject_ex()

It was used to pass libctx and propq, which would override the
corresponding values passed to by_store_ctrl_ex().  This wasn't
really reasonable to do either way, as it could potentially be a
surprise to the user, who can reasonably expect that the URI is
opened with the libctx and propq that was passed with the URI, and
not with those passed later.

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

(cherry picked from commit af5952d533b772ef8a3d7c666ed918acfc1dd911)

3 months agoAdd test_verify tests
Dr. David von Oheimb [Wed, 30 Apr 2025 09:46:03 +0000 (11:46 +0200)] 
Add test_verify tests

Originally from https://github.com/openssl/openssl/pull/27507, with some
changes.

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

(cherry picked from commit 927debaf7b4e83e47d3f016808acab947cc50ea2)

3 months agoRework the "by store" X509_LOOKUP method to open the given URI early
Richard Levitte [Wed, 30 Apr 2025 09:38:04 +0000 (11:38 +0200)] 
Rework the "by store" X509_LOOKUP method to open the given URI early

The cached X509_LOOKUP method data is no longer just the URI, but now
includes the OSSL_STORE_CTX pointer, and required parameters to reopen
the URI at any time.  cache_objects() is modified to handle this, and
only (re)open the URI when it wasn't previously opened, or when it was
closed by an earlier call.

This way, we can call OSSL_STORE_open_ex() in by_store_ctrl_ex(), and
get to see possible errors when the URI is loaded.

This assumes that if the URI could be opened once, it can be opened
again.

Fixes #27461

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

(cherry picked from commit 0c48ee2bf513cbc2f1de2ff8bc11750e4b593620)

3 months agoDisable unterminated-string-initialization in strict-warnings
Neil Horman [Thu, 24 Apr 2025 13:26:33 +0000 (09:26 -0400)] 
Disable unterminated-string-initialization in strict-warnings

Recently updated to fedora 42, which includes an updated gcc, which
triggers a new warning:

test/afalgtest.c:44:9: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (18 chars into 17 available) [-Werror=unterminated-string-initialization]
   44 |         "\x53\x69\x6e\x67\x6c\x65\x20\x62\x6c\x6f\x63\x6b\x20\x6d\x73\x67"

The warning occurs because in some locations we create char buffers of
length X, and fill it with X bytes of data, truncating the NULL
terminator.

We could fix it by adding the nonstring attribute, but given that:
1) Adding attributes might impact other platforms that don't understand the
   attribute.

2) We often create char buffers that don't expect a NULL terminator.

3) Converting the unsigned char arrays to uint8_t, or other types that
   could be interpreted as non-strings has no impact, only applying the
   nonstring attribute silences the warning.

It seems more sensible to just disable the warning entirely

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

(cherry picked from commit d08d77789e20e8b47a48f4d0a998ccfcde9d389b)

3 months agoUpdate test/ossl_store_test.c
Neil Horman [Tue, 29 Apr 2025 13:27:30 +0000 (09:27 -0400)] 
Update test/ossl_store_test.c

Co-authored-by: Viktor Dukhovni <viktor1ghub@dukhovni.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27393)

(cherry picked from commit 934086fb9161e2f4967ad8577a1f3e489cff73d2)

3 months agoUpdate test/ossl_store_test.c
Neil Horman [Tue, 29 Apr 2025 13:24:46 +0000 (09:24 -0400)] 
Update test/ossl_store_test.c

Co-authored-by: Viktor Dukhovni <viktor1ghub@dukhovni.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27393)

(cherry picked from commit 1dc52b4f7d8f14ec892a91663b797a39b80c7d35)

3 months agoAdding winstore open test
Neil Horman [Tue, 15 Apr 2025 18:46:27 +0000 (14:46 -0400)] 
Adding winstore open test

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

(cherry picked from commit 52e8814de3b35aa280b5323aa743229e0b61ddc8)

3 months agosslecho: Rename bool to flag to avoid C23 conflict
Tomas Mraz [Mon, 28 Apr 2025 14:00:32 +0000 (16:00 +0200)] 
sslecho: Rename bool to flag to avoid C23 conflict

Fixes #27516

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

(cherry picked from commit 81ce3d3ae8f6c4021e0dce86891e869efa1710db)

3 months agoFix a typo in evpciph_des3_common.txt
Matt Caswell [Thu, 17 Apr 2025 11:45:31 +0000 (12:45 +0100)] 
Fix a typo in evpciph_des3_common.txt

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

(cherry picked from commit 29464b4c15db4c4063633743254986a91b91dd33)

3 months agoFix a deadlock while attempting to get the Primary EVP_RAND_CTX
Matt Caswell [Tue, 15 Apr 2025 14:03:36 +0000 (15:03 +0100)] 
Fix a deadlock while attempting to get the Primary EVP_RAND_CTX

When only the FIPS provider was loaded we could get a deadlock when
calling RAND_get0_primary() due to attempting to obtain a recursive
lock.

We reduce the scope of the locks that we hold to avoid this.

Fixes #27391

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

(cherry picked from commit 01ea08049815325bf7719499f58c3799aa3fb555)

3 months agoEnsure that our fips internal provider is always loaded
Matt Caswell [Wed, 16 Apr 2025 11:20:10 +0000 (12:20 +0100)] 
Ensure that our fips internal provider is always loaded

The fips provider has an internal provider. In some circumstances we
could end up trying to find it, but failing because it hasn't been loaded
yet. We just always ensure it is loaded early to avoid this.

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

(cherry picked from commit 6ff4c1d87468fdd18deeebbb01fbf049bd6cec1f)

3 months agoAssert that we successfully obtained a lock
Matt Caswell [Wed, 16 Apr 2025 11:15:51 +0000 (12:15 +0100)] 
Assert that we successfully obtained a lock

We should never fail to obtain a lock, so assert that we are successful

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

(cherry picked from commit 606de509e3828fd2fb65184500e6197c82a0efcf)

3 months agoAdd a test for calling RAND_get0_primary()
Matt Caswell [Wed, 16 Apr 2025 11:14:55 +0000 (12:14 +0100)] 
Add a test for calling RAND_get0_primary()

We simply test that calling RAND_get0_primary() returns a success
for both the default and fips providers.

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

(cherry picked from commit 273c75e8636fb28be3d56ef0bd7b67b7451a0bef)

3 months agoFix aesv8 arm assembler code not working on 32 bit Android
Arne Schwabe [Sat, 26 Apr 2025 18:21:28 +0000 (20:21 +0200)] 
Fix aesv8 arm assembler code not working on 32 bit Android

OpenSSL uses 'void' as perlasm for the 32 bit armeabi-arm target, which
most notably lacks a 32 or 64 in its name. So while most code that is
targeted for 32 uses !~ /64/ there is one instance that uses ~= /32/,
introduced by commit 8e69c18 between 3.4.0 and 3.5.0. This leaves out
that line on 32 bit android causing a segfault.

This fixes the compilation issue by replacing the ~= /32/ with !~ /64/
compilation taget (see 15-android.conf)

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27510)

(cherry picked from commit 77624f0c5bc7db67acb3134b28bc330533425ab6)

3 months agoossl_json_f64() seems to be unused, remove it to avoid libm dependency
sashan [Fri, 18 Apr 2025 10:09:52 +0000 (12:09 +0200)] 
ossl_json_f64() seems to be unused, remove it to avoid libm dependency

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

(cherry picked from commit 0e418628998d0337599643c1e4054c60e5f21ec4)

3 months agoClarify how s_client -ign_eof and -quiet impact command processing
Matt Caswell [Fri, 25 Apr 2025 14:21:47 +0000 (15:21 +0100)] 
Clarify how s_client -ign_eof and -quiet impact command processing

If -ign_eof -or -quiet are passed to s_client this implicitly turns off
command processing (i.e. equivalent to -nocommands). This was stated on
the man page in the "CONNECTED COMMANDS" section, but not in the
documentation for "-ign_eof" or "-quiet" directly. We state it here as
well to make it clearer.

Fixes #27443

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

(cherry picked from commit 20fb5dcb1e2b762545aa127058cc11efe09d6700)

3 months agoTest+fix handling "wrong" downgrade signals
Anton Tieleman [Mon, 28 Apr 2025 11:49:25 +0000 (13:49 +0200)] 
Test+fix handling "wrong" downgrade signals

This accounts for cases that can only occur when een non-compliant server sends
the wrong downgrade signal. (TLS1.1 signal when negotiating TLS1.2 or TLS1.2
signal when negotiating TLS1.0/TLS1.1). According to the TLS1.3 RFC these
cases should be rejected:

RFC8446, section 4.1.3: TLS 1.3 clients receiving a ServerHello indicating
TLS 1.2 or below MUST check that the last 8 bytes are not equal to either of
these values. TLS 1.2 clients SHOULD also check that the last 8 bytes are
not equal to the second value if the ServerHello indicates TLS 1.1 or below.

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

(cherry picked from commit 290fd4a0c87b5f777e928a80503ee20ca6e768de)

3 months agoRepair downgrade tests
Anton Tieleman [Mon, 28 Apr 2025 11:30:01 +0000 (13:30 +0200)] 
Repair downgrade tests

A number of these tests were failing for the wrong reasons. The intention is to verify
that the client sends an illegal parameter alert when an unexpected downgrade signal
is received. Instead, a number of tests failed because TLS1.1 was not available. The
tests are adapted to explicitly check for an illegal parameter alert from the client.

Client and server flags are updated to enable TLS1.1 where required and a few tests
requiring TLS1.1 were moved to be disabled when TLS1.1 is not available.

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

(cherry picked from commit 7535f26210afa386fe9021a79dbaea13fbb9e649)

3 months agoAdded quotes to mask spaces in the path when building
Martin Rauch [Fri, 25 Apr 2025 08:30:16 +0000 (10:30 +0200)] 
Added quotes to mask spaces in the path when building

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

(cherry picked from commit 978a4e199d60b8616180128c5d709d9600409113)

3 months agoBIO_dump_indent_cb(): Check for negative return from BIO_snprintf()
Tomas Mraz [Fri, 25 Apr 2025 08:04:37 +0000 (10:04 +0200)] 
BIO_dump_indent_cb(): Check for negative return from BIO_snprintf()

In practice this cannot happen but Coverity complains.

Fixes Coverity 1646683

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

(cherry picked from commit 56c739816f3dacbb024ceae29c546abe677ee02c)

3 months agoFix also BIO_printf formatting for INF and NAN
Bernd Edlinger [Thu, 24 Apr 2025 19:09:40 +0000 (21:09 +0200)] 
Fix also BIO_printf formatting for INF and NAN

Avoid infinite loooooooops in %e and %g formatting for +/-INF and
make the invalid value at least visible by using '?' as signvalue.

Fixes #26973

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

(cherry picked from commit b56dd5bfec8e790cc2d5b1bdca6ecd350a3b7779)

3 months agoFix POD indentation in OSSL_CMP_CTX_new
Nicholas Brink [Wed, 23 Apr 2025 17:22:56 +0000 (13:22 -0400)] 
Fix POD indentation in OSSL_CMP_CTX_new

Fixes #27459

Sourced from
https://github.com/quictls/quictls/commit/0c12a613effc9dac8abc9a68e31e641d0cdb6541

Plus one line of documentation fixes

CLA: trivial

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

(cherry picked from commit f417a91f2f27f660360bfd4bed83cba4b4df6a74)

3 months agoTest ML-DSA, SLH-DSA, and ML-KEM PCT implementations
Joachim Vandersmissen [Fri, 18 Apr 2025 16:09:05 +0000 (11:09 -0500)] 
Test ML-DSA, SLH-DSA, and ML-KEM PCT implementations

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

(cherry picked from commit 3f28cc6e63cdafdea08921abf12066ddfc68e6ec)

3 months agoMove to error state if ML-DSA / SLH-DSA PCT fails
Joachim Vandersmissen [Fri, 18 Apr 2025 16:07:53 +0000 (11:07 -0500)] 
Move to error state if ML-DSA / SLH-DSA PCT fails

As required by FIPS 140-3 AS10.07, if the module fails a self-test, it
shall enter an error state.

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

(cherry picked from commit 17cacc1a1c85b65ba94f76890810d2ada6243f38)

3 months agoFacilitate corruption in ML-DSA PCT
Joachim Vandersmissen [Fri, 18 Apr 2025 16:07:43 +0000 (11:07 -0500)] 
Facilitate corruption in ML-DSA PCT

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

(cherry picked from commit 89b5a9b8bcf6bfc6d210a8078c43e6f8f77c1377)

3 months agopoll builder: add dummy field
Gerd Hoffmann [Fri, 25 Apr 2025 05:51:53 +0000 (07:51 +0200)] 
poll builder: add dummy field

The microsoft compiler does not like the empty struct,
so go add a dummy field instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27494)

(cherry picked from commit 04b59c419933adca4cde1d97e2c7522cb21c3468)

3 months agoFix P-384 curve on lower-than-P9 PPC64 targets
A. Wilcox [Thu, 17 Apr 2025 13:51:53 +0000 (08:51 -0500)] 
Fix P-384 curve on lower-than-P9 PPC64 targets

The change adding an asm implementation of p384_felem_reduce incorrectly
uses the accelerated version on both targets that support the intrinsics
*and* targets that don't, instead of falling back to the generics on older
targets.  This results in crashes when trying to use P-384 on < Power9.

Signed-off-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
Closes: #27350
Fixes: 85cabd94 ("Fix Minerva timing side-channel signal for P-384 curve on PPC")
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27429)

(cherry picked from commit 29864f2b0f1046177e8048a5b17440893d3f9425)

3 months agoProperly zeroize ML-KEM z and d values
Joachim Vandersmissen [Fri, 18 Apr 2025 17:48:24 +0000 (12:48 -0500)] 
Properly zeroize ML-KEM z and d values

Ensure z and d are actually zeroized by cleansing the full size of s,
rather than just vector_bytes.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27437)

(cherry picked from commit 5d44f67aafb26ea3adcd33cd6d34bc17e40466cb)

3 months agoAdd a test for calling SSL_accept() on a listener
Matt Caswell [Fri, 11 Apr 2025 13:21:48 +0000 (14:21 +0100)] 
Add a test for calling SSL_accept() on a listener

We expect this scenario to fail

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

(cherry picked from commit b637fbe781ab40afca700a44fa78b8748f5892dd)

3 months agoFix errors on SSL_accept() and SSL_get_error()
Matt Caswell [Fri, 11 Apr 2025 13:19:46 +0000 (14:19 +0100)] 
Fix errors on SSL_accept() and SSL_get_error()

Calling SSL_accept() was raising two errors on the stack if you passed
the wrong object type. Similarly SSL_get_error() was adding an error to
the stack if the wrong object type was passed and returning the wrong
result.

We also ensure SSL_set_accept_state() and SSL_set_connect_state() don't
raise spurious errors since these are void functions.

Fixes #27347
Fixes #27348

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

(cherry picked from commit cb5bb8916fa0e044e6658c8b3db6d7c672cb25fe)

3 months agoRevert "Temporarily disable gost-engine tests in ci"
Neil Horman [Thu, 3 Apr 2025 21:52:44 +0000 (17:52 -0400)] 
Revert "Temporarily disable gost-engine tests in ci"

This reverts commit db9771b5a056d939b6112cdc099fbf4f86d184ee.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(cherry picked from commit 172076029c0bbb188e321f5832f6a15971834e90)

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

3 months agoupdate to latest version of gost-engine
Neil Horman [Thu, 3 Apr 2025 21:51:46 +0000 (17:51 -0400)] 
update to latest version of gost-engine

Need to pull in the latest version of its submodule, libprov which has
fixes for cmake 4.0

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(cherry picked from commit ae1396488721750f7482d2ec60950080312e1518)

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

3 months agoFix BIO_printf formatting for negative numbers formatted with %e
Richard Levitte [Wed, 23 Apr 2025 08:26:56 +0000 (10:26 +0200)] 
Fix BIO_printf formatting for negative numbers formatted with %e

Some parts of the formatting code assumed that the input number is
positive.  This is fixed by working on its absolute value.

test/bioprinttest.c is amended to test the output of negative numbers
as well.

Fixes #26973

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

(cherry picked from commit fb555eb7a1d523e9df5584b44d16d0f72417bd19)

3 months agodocs: update OSSL_PARAM_int documentation
Ryan Schanzenbacher [Sat, 8 Mar 2025 04:35:32 +0000 (23:35 -0500)] 
docs: update OSSL_PARAM_int documentation

This change adds an example to allow compilation without warnings using
compiler options like `-Wincompatible-pointer-types-discards-qualifiers`

Code for the example was inspired by libarchive's https://github.com/libarchive/libarchive/pull/1869/commits/9e3a7e4b6c77e8aa19a69430f48917dbc15b319d

Fixes #20956

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

(cherry picked from commit b83b67fe59511de951db1987fb2ab9e028e2da32)

3 months agoFix URL parsing to handle missing ports and ISO 8601 timestamps in paths
olszomal [Fri, 3 Jan 2025 07:42:55 +0000 (08:42 +0100)] 
Fix URL parsing to handle missing ports and ISO 8601 timestamps in paths

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

(cherry picked from commit 56910e7211363de26d3975635f4968c55de08eb6)

3 months agoTypo in TLS introduction
Christian Wansart [Mon, 21 Apr 2025 09:39:23 +0000 (11:39 +0200)] 
Typo in TLS introduction

CLA: trivial

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

(cherry picked from commit 9eb2c13432a703dc07c9ae021949c96517ce5246)

3 months agoReplace ilammy/setup-nasm with nasm install from choco
Dmitry Misharov [Tue, 22 Apr 2025 07:52:14 +0000 (09:52 +0200)] 
Replace ilammy/setup-nasm with nasm install from choco

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

(cherry picked from commit 1ad186986c8c90dfc58666531c0554641e022dbb)

3 months agoDocument SSL_CTX_set_min_proto_version defaults
Norbert Pocs [Wed, 16 Apr 2025 13:44:07 +0000 (15:44 +0200)] 
Document SSL_CTX_set_min_proto_version defaults

If the function is not called the settings default to 0.

Fixes #10584

Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27410)

(cherry picked from commit 871182d29dc24bbb51ff7a4d952ff9d9868f14b5)

3 months agoprovider-signature.pod: fix typos (digeset -> digest)
Dr. David von Oheimb [Mon, 14 Apr 2025 08:48:10 +0000 (10:48 +0200)] 
provider-signature.pod: fix typos (digeset -> digest)

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

(cherry picked from commit 7d14d1c46a6144c5f8eafc8d07b750324e1275be)

3 months agoprovider-signature.pod: fix doc of OSSL_SIGNATURE_PARAM_ALGORITHM_ID, describing...
Dr. David von Oheimb [Sun, 13 Apr 2025 19:58:35 +0000 (21:58 +0200)] 
provider-signature.pod: fix doc of OSSL_SIGNATURE_PARAM_ALGORITHM_ID, describing its relevance

This provides a fix for the documentation part of #22932.

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

(cherry picked from commit 23e3b3c0c5d8f29d95f518a1f0e40f3e1c63ead9)

3 months agotest: test for setting hkdf salt to null
Pauli [Wed, 9 Apr 2025 02:42:40 +0000 (12:42 +1000)] 
test: test for setting hkdf salt to null

Fixes #27302

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27305)

(cherry picked from commit 727117960c0a47073290de936fb517db12351174)

3 months agohkdf: allow salt to be set to null
Pauli [Wed, 9 Apr 2025 02:42:10 +0000 (12:42 +1000)] 
hkdf: allow salt to be set to null

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27305)

(cherry picked from commit 12eb6c58ff2a8d857924b3020d30c8d485ace0a7)

3 months agoFix OSSL_FUNC_keymgmt_load declaration in man7/provider-keymgmt
Mironenko [Fri, 28 Mar 2025 10:41:26 +0000 (13:41 +0300)] 
Fix OSSL_FUNC_keymgmt_load declaration in man7/provider-keymgmt

OSSL_FUNC_keymgmt_load prototype declared in man7 does not match
the actual OSSL_FUNC_keymgmt_load prototype declared in
include/openssl/core_dispatch.h. This commit fixes the prototype
in man7.

CLA: trivial

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

(cherry picked from commit ada231523f6569c92795e16c9a61b7190f2032b1)

3 months agoFix winstore provider to work with recent decoder changes
Neil Horman [Mon, 14 Apr 2025 15:03:02 +0000 (11:03 -0400)] 
Fix winstore provider to work with recent decoder changes

Changes made recently in commit 31b5f3f made changes to how a default
decoder was created, in which ossl_decoder_instance_new() started
returning null.  Other storemgmt providers were updated to start using
ossl_decoder_instance_new_forprov, but the winstore manager seems to
have got missed.  Fix it up properly

Fixes #27355

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27384)

(cherry picked from commit 8419baf31222c5f439b09ceb41f7a6e1916eab3b)

3 months agoFix EVP_PKEY_CTX_dup() so that it copies the keymanager.
slontis [Wed, 9 Apr 2025 00:05:09 +0000 (10:05 +1000)] 
Fix EVP_PKEY_CTX_dup() so that it copies the keymanager.

A call to EVP_PKEY_CTX_new() creates a keymgmt pointer internally,
but EVP_PKEY_CTX_dup() does not copy this field.

Calling EVP_PKEY_derive_set_peer_ex() after EVP_PKEY_CTX_dup() resulted
in a segfault because it tried to access this pointer.

EVP_PKEY_CTX_dup() has been updated to copy the keymanager (and upref it).

Reported by Eamon ODea (Oracle).

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

(cherry picked from commit 3c22da73465f5dd211299e64f0de8786dcaf86c3)

3 months agoFix PKCS7_sign and CMS_sign default hash documentation
David Benjamin [Mon, 7 Apr 2025 20:40:05 +0000 (16:40 -0400)] 
Fix PKCS7_sign and CMS_sign default hash documentation

Fixes #27291. See issue for details.

Reviewed-by: Paul Yang <kaishen.yy@antfin.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/27292)

(cherry picked from commit 4f81470afadea3d1582d1df7f1b2b5e3ece63331)

3 months agoUpdated the change log to include SSLv3 being disabled by default.
emery [Mon, 7 Apr 2025 15:02:00 +0000 (11:02 -0400)] 
Updated the change log to include SSLv3 being disabled by default.

This change was implemented into version 1.1.0 and onward. The last version that had SSLv3 enabled was version 1.0.2h, which is why the addition was made where it is.

CLA: trivial

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

(cherry picked from commit 6509f18c9fdbf76a63e8c6056da989cd047a7fb2)

3 months agorio: add RIO_POLL_METHOD_NONE
Gerd Hoffmann [Mon, 7 Apr 2025 12:06:28 +0000 (14:06 +0200)] 
rio: add RIO_POLL_METHOD_NONE

Fixes build on UEFI.

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

(cherry picked from commit 7e53ffa144264024aa7e596c04c998946b4d85b8)

3 months agohashfunc: add stddef.h include
Gerd Hoffmann [Mon, 7 Apr 2025 11:29:36 +0000 (13:29 +0200)] 
hashfunc: add stddef.h include

size_t is declared in stddef.h, so include the header file to
make sure it is available.  Fixes build on UEFI.

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

(cherry picked from commit 44e9c5a3edd199ed7d7fe427fe0e1ef76dc52663)

3 months agocrypto: disable OSSL_PARAM_REAL on UEFI
Gerd Hoffmann [Mon, 7 Apr 2025 10:58:54 +0000 (12:58 +0200)] 
crypto: disable OSSL_PARAM_REAL on UEFI

Floating point types like double can't be used on UEFI.
Fix build on UEFI by disabling the OSSL_PARAM_REAL branch.

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

(cherry picked from commit 57f94478060faeb688ebbd9fde1aa73abae00636)

3 months agoRemove DAYS argument
Malcolm Hogan [Fri, 7 Mar 2025 23:30:43 +0000 (18:30 -0500)] 
Remove DAYS argument

This commit removes DAYS from certificate requests to avoid the warning

'Ignoring -days without -x509; not generating a certificate'

This argument is not needed with the -new argument. Additionally makes sure
$1 is handled when -nodes is not given. Preventing an uninitialized value
error when the DAYS argument is removed.

Fixes #26595

CLA: trivial

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

(cherry picked from commit d890ad2b96efea4f5f4b0db190017ce9a3897df7)

3 months agoFix potential NULL pointer dereference in final_maxfragmentlen()
Andrey Tsygunka [Fri, 4 Apr 2025 11:58:40 +0000 (14:58 +0300)] 
Fix potential NULL pointer dereference in final_maxfragmentlen()

In the final_maxfragmentlen() function, s->session is checked
for NULL after it was dereferenced earlier.
So move this NULL check to the top of the function.

CLA: trivial

Fixes: fa49560451 (Fix handling of max_fragment_length extension for PSK)
Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/27272)

(cherry picked from commit 28de1f5004c1083d358e6934552124a201e0251e)

3 months agoFix test failures on big endian ARMv9 target
Bernd Edlinger [Thu, 3 Apr 2025 12:33:25 +0000 (14:33 +0200)] 
Fix test failures on big endian ARMv9 target

This fixes a couple of big-endian issues in the
assembler code of chacha, SM3 and SM4.

Fixes #27197
Tested-by: @zeldin
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27252)

(cherry picked from commit 1a81d509a001607e40eb49174fa555068bdf7c48)

3 months agossl/ssl_lib.c: Avoid crash when SSL_CONNECTION is NULL
Graham Leggett [Wed, 2 Apr 2025 11:08:11 +0000 (12:08 +0100)] 
ssl/ssl_lib.c: Avoid crash when SSL_CONNECTION is NULL

Detection for sc == NULL is performed after sc is used. Add the
check to the correct place.

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

(cherry picked from commit 7f6cc862c69800a72c49fcfe89e2931ee4ca2e7a)

3 months agocrypto/ui/ui_lib.c: Add OPENSSL_free to avoid memory leaks
JiashengJiang [Tue, 1 Apr 2025 01:22:53 +0000 (21:22 -0400)] 
crypto/ui/ui_lib.c: Add OPENSSL_free to avoid memory leaks

Add OPENSSL_free() if general_allocate_boolean() or general_allocate_string fails to avoid memory leaks.

Fixes: a63d5eaab2 ("Add a general user interface API. This is designed to replace things like des_read_password and friends (backward compatibility functions using this new API are provided). The purpose is to remove prompting functions from the DES code section as well as provide for prompting through dialog boxes in a window system and the like.")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
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/27218)

(cherry picked from commit 8f06efe234ca875eb09af7f35f1ad3d62be696aa)

3 months agoAdd a test for calling SSL_accept() on an accepted connection
Matt Caswell [Mon, 7 Apr 2025 10:45:25 +0000 (11:45 +0100)] 
Add a test for calling SSL_accept() on an accepted connection

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

(cherry picked from commit 44af96b9c57573e20b52d2204dfe0ff3bd53dc39)

3 months agoDocument the state of the object you get from SSL_accept_connection()
Matt Caswell [Mon, 7 Apr 2025 09:12:55 +0000 (10:12 +0100)] 
Document the state of the object you get from SSL_accept_connection()

The object may or may not have completed its handshake.

See also:
https://github.com/openssl/openssl/pull/27239#issuecomment-2772148408

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

(cherry picked from commit 6d8e516e0877e3bc363002b79877bce558ffbd4b)

3 months agoFix SSL_accept()
Matt Caswell [Mon, 7 Apr 2025 08:58:30 +0000 (09:58 +0100)] 
Fix SSL_accept()

If you have a QUIC server SSL connection object, you should be able to
call SSL_accept() on it.

Fixes #27282

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

(cherry picked from commit 38bf6f3036d1baddbe4618a219aaf17d460091d9)

3 months agoTest that SSL_poll does not report a stream as writable if it isn't
Matt Caswell [Wed, 9 Apr 2025 12:08:09 +0000 (13:08 +0100)] 
Test that SSL_poll does not report a stream as writable if it isn't

We consume all the credit and check the stream is no longer writeable

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

(cherry picked from commit 85a8eba56769c4d25a66e0b52e8fb3e76bbe4afe)

3 months agoPrevent SSL_poll from reporting a stream as writeable if it isn't
Matt Caswell [Wed, 9 Apr 2025 12:06:24 +0000 (13:06 +0100)] 
Prevent SSL_poll from reporting a stream as writeable if it isn't

The CWM might prevent a stream from being writeable. We should not report
a stream as writeable if there is no credit.

Fixes #27312

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

(cherry picked from commit 4efd1a26822a05e900a9dcffc0d6554efece7923)

3 months agocmp_client_test.c: relax tight timeout value in test_exec_IR_ses_poll_no_timeout()
Dr. David von Oheimb [Thu, 3 Apr 2025 10:43:20 +0000 (12:43 +0200)] 
cmp_client_test.c: relax tight timeout value in test_exec_IR_ses_poll_no_timeout()

Fixes #27165

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27249)

(cherry picked from commit 46e14174da24a5f4fd5c480f1906371e2edd62cb)

3 months agoPrepare for 3.5.1 27298/head
openssl-machine [Tue, 8 Apr 2025 13:09:15 +0000 (13:09 +0000)] 
Prepare for 3.5.1

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

3 months agoPrepare for release of 3.5.0 openssl-3.5.0
openssl-machine [Tue, 8 Apr 2025 13:09:06 +0000 (13:09 +0000)] 
Prepare for release of 3.5.0

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

3 months agomake update
openssl-machine [Tue, 8 Apr 2025 13:09:05 +0000 (13:09 +0000)] 
make update

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

3 months agoCopyright year updates
openssl-machine [Tue, 8 Apr 2025 13:07:23 +0000 (13:07 +0000)] 
Copyright year updates

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Release: yes

3 months agoAdd known issues to NEWS.md for 3.5.0
Neil Horman [Mon, 7 Apr 2025 13:09:09 +0000 (09:09 -0400)] 
Add known issues to NEWS.md for 3.5.0

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

(cherry picked from commit 30adecd7258b1c657466f1ecf0c1d29491aac0b4)

4 months agoREADME: Remove client only restriction for QUIC.
Sebastian Andrzej Siewior [Thu, 3 Apr 2025 21:17:54 +0000 (23:17 +0200)] 
README: Remove client only restriction for QUIC.

The QUIC protocol is also supported on server side.
Update the README file accordingly.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27258)

(cherry picked from commit 648366ad010b3b22c1f298d39934d72702b3fd55)

4 months agoFix code style in quicapitest.c
Samson S. Kolge [Fri, 4 Apr 2025 12:19:52 +0000 (17:49 +0530)] 
Fix code style in quicapitest.c

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

(cherry picked from commit ba46275556ae93e44f27fece2d25655b42ce2842)

4 months agoFix SSL_new() with QUIC_server_method and improve formatting (Fixes #27255)
Samson S. Kolge [Fri, 4 Apr 2025 11:38:22 +0000 (17:08 +0530)] 
Fix SSL_new() with QUIC_server_method and improve formatting (Fixes #27255)

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

(cherry picked from commit 5341e271d9eb211d3b61d370a68ee4ce4147cd12)

4 months agoFix a reference in the OpenSSL guide to QUIC for servers
Matt Caswell [Fri, 4 Apr 2025 09:12:46 +0000 (10:12 +0100)] 
Fix a reference in the OpenSSL guide to QUIC for servers

One part of the OpenSSL guide suggests we only support clients for QUIC
which is no longer true.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27265)

(cherry picked from commit 0a16bb7e740306a10c14a6f92c42782f9b5e2048)

4 months agoUpdate README-QUIC.md with server-side QUIC support information
Samson S. Kolge [Wed, 2 Apr 2025 10:32:10 +0000 (16:02 +0530)] 
Update README-QUIC.md with server-side QUIC support information

- Add information about OpenSSL 3.5 server-side QUIC support

- Include specific command instructions for running the QUIC server example

- Explicitly note that s_server does NOT support QUIC

- Fix documentation formatting (trailing spaces and blank lines around code blocks)

Signed-off-by: Samson S. Kolge <eglok1980@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27230)

(cherry picked from commit c66e00398c9feabc02ff6e678089a3dc95f985d2)

4 months agoFix a visual glitch in test_cmp_http.t
Bernd Edlinger [Fri, 21 Mar 2025 19:58:57 +0000 (20:58 +0100)] 
Fix a visual glitch in test_cmp_http.t

Kill the shell process after the Mock server is running,
to prevent the shell from printing an error message when
the Mock server is finally killed.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
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/27144)

(cherry picked from commit c45f0dd80370f1aa942cf47fc5ea99cb887621e4)

4 months agoDetect segfault in the pkeyutl test
Matt Caswell [Tue, 1 Apr 2025 09:32:00 +0000 (10:32 +0100)] 
Detect segfault in the pkeyutl test

Some tests are expected to fail in the pkeyutl test. However, if a segfault
occurs then that counts as a failure and the test passes. A segfault should
never be a "pass".

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

(cherry picked from commit ff5a272e605633b9cba30ee9440cf05b90e903d9)

4 months agoFix a segfault in the pkeyutl command line app
Matt Caswell [Tue, 1 Apr 2025 09:31:33 +0000 (10:31 +0100)] 
Fix a segfault in the pkeyutl command line app

Don't attempt to deref a pkey that is NULL

Fixes #27156

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

(cherry picked from commit 3f0f723b521b5138f9ac77ede45a77dc46a734d4)

4 months agoTemporarily disable gost-engine tests in ci
Neil Horman [Tue, 1 Apr 2025 17:16:04 +0000 (13:16 -0400)] 
Temporarily disable gost-engine tests in ci

We need to temporarily disable this as we have a build break in CI:
https://github.com/openssl/openssl/actions/runs/14192630435

Its occuring because gost-engine depends on libprov, which requires a
minimum version cmake-3.0.  The update of github runners to cmake-4.0
causes a bail out as cmake 4.0 no longers supports cmake 3.0 syntax.

Libprov is fixed now, but gost-engine needs to update its libprov
submodule, and then we need to update the gost-engine submodule.  Until
thats done (which may take days), we should disable the gost-engine
external tests

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

(cherry picked from commit db9771b5a056d939b6112cdc099fbf4f86d184ee)

4 months agoLink SSL_get_negotiated_group() and SSL_get0_group_name() in the docs
Matt Caswell [Mon, 31 Mar 2025 14:51:14 +0000 (15:51 +0100)] 
Link SSL_get_negotiated_group() and SSL_get0_group_name() in the docs

If you are intereseted in one you might be interested in the other.

Fixes #27137

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

(cherry picked from commit 9eb21877f5704595a89cd550b1a639df86229b09)

4 months agofix OOB issue in AVX-512 XTS decryption
Dan Pittman [Mon, 31 Mar 2025 17:28:41 +0000 (10:28 -0700)] 
fix OOB issue in AVX-512 XTS decryption

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27216)

(cherry picked from commit 8ca8f9afbb870293fb0a9dd74cfead9b7767596f)

4 months agostatem: always save sigalgs during PHA
Benjamin Kaduk [Fri, 14 Jun 2024 21:10:39 +0000 (14:10 -0700)] 
statem: always save sigalgs during PHA

We use the same extension-parsing function on server and client
for convenience, but while the server might worry about tracking
what was previously received and not overwriting it, on the client
receiving a request for post-handshake authentication, we always
want to use the values from the current extension (and should
always have a new session object that we are free to mutate).

It is somewhat unclear whether the server also needs the check
for a resumed connection; it appears to have been added back in
2015 in commit 062178678f5374b09f00d70796f6e692e8775aca as part
of a broad pass to handle extensions on resumption, but without
specific documentation of each extension's handling.

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

(cherry picked from commit ddd99d52d30e2fdae08f9684947cba45ce53898b)

4 months agoFix more quic_multistream test formatting
Neil Horman [Sat, 29 Mar 2025 21:52:20 +0000 (17:52 -0400)] 
Fix more quic_multistream test formatting

We encountered another failure in the quic_multistream_test:
https://github.com/openssl/openssl/actions/runs/14127125173/job/39578660601#step:9:1005

It appears we still occasionally get empty frames in our qlog, with the
validate-qlog.py scripts properly bails out on.  In the above case, the
offending frame entry looked like this:
{
  "name": "transport:packet_received",
  "data": {
    "header": {
      "packet_type": "initial",
      "packet_number": 4,
      "dcid": "",
      "scid": "6217813c336a012a"
    },
    "datagram_id": 6,
    "frames": [
      {
        "frame_type": "new_token",
        "token": {
          "raw": {
            "data": "44801add5794"
          }
        },
        "length": 8
      },
      {
        "frame_type": "stream",
        "stream_id": 15897,
        "offset": 625652585,
        "payload_length": 11,
        "explicit_length": true,
        "fin": true,
        "length": 8
      },
      {}    <= NOTE EMPTY FRAME HERE
    ]
  },
  "time": 0
}

I think we're still missing some frame formatting cases in
script_21_inject_plain(), which can format potentially any of the frames
listed in the forbidden_frame_types array when running the
test_dyn_frame_types test.

I think we need to enumerate all of those frame types in the case
statement we have there.  Fortunately we generally don't have to provide
sane values, and most of the cases fall into 4 categories (those that
need a 64 bit data value, and those that require 1, 2 or 3 variable
integers).  There are two special cases, NEW_TOKEN, and NEW_CONNECTION,
but those just need a mix of fixed and variable width data.

So lets fully enumerate those and hopefully put this to bed.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/27200)

(cherry picked from commit 0162f75fb1ae4adfb56f022884d8325521bcc141)

4 months agoFix cpp comment in windows build
slontis [Fri, 28 Mar 2025 08:35:42 +0000 (19:35 +1100)] 
Fix cpp comment in windows build

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

(cherry picked from commit b8860598d2f7eab14fcf63c22579d879615465c8)

4 months agoFix Strict c issue in aes_gcm for armv8
slontis [Sun, 30 Mar 2025 22:42:59 +0000 (09:42 +1100)] 
Fix Strict c issue in aes_gcm for armv8

Reported by David Makepeace

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

(cherry picked from commit 0a78595eac55cc9ec9d2046c704404ec52752b8c)

4 months agoAdded 3.5 to coveralls.yml
Vavroch [Sun, 30 Mar 2025 07:49:59 +0000 (09:49 +0200)] 
Added 3.5 to coveralls.yml

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

(cherry picked from commit b3955eaa26f25fc43bdb6b2f299c89f685b5b7b6)

4 months agoFix sigalg corner cases
Viktor Dukhovni [Wed, 26 Mar 2025 10:36:08 +0000 (21:36 +1100)] 
Fix sigalg corner cases

- Tolerate RSA PKCS#1 *certificate* signatures when
  the peer sigals include RSA PSS with the same digest.

  Now that we're more strict about not sending sigalgs that are out of
  protocol range, when the client supports TLS 1.3 only, we might refuse
  to return an RSA PKCS#1-signed cert.

- Don't send TLS 1.3 sigalgs when requesting client certs from
  a TLS 1.2 client.

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

(cherry picked from commit a5f98e6da521934455898d49c8b2152a60b46925)

4 months agoFix c++ comment in ec code.
slontis [Fri, 28 Mar 2025 07:57:48 +0000 (18:57 +1100)] 
Fix c++ comment in ec code.

This is a 9 month old change, so I am not sure why it is only causing a
compile issue now.

Reported by David Makepeace

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

(cherry picked from commit ea77608920e88812a5278be351e3ebbfdb81d992)

4 months agoFix probing the registry for configuration
Branden Clark [Tue, 28 Jan 2025 15:50:10 +0000 (16:50 +0100)] 
Fix probing the registry for configuration

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

(cherry picked from commit 908e0f37288b76132c166364c75cbac9f46deb9f)

4 months agocrypto: windows: use LPCTSTR for the temp registry buffer
Hugo Beauzée-Luyssen [Mon, 27 Jan 2025 07:36:30 +0000 (08:36 +0100)] 
crypto: windows: use LPCTSTR for the temp registry buffer

mingw-w64 only defines LPCTCH when UNICODE isn't defined
crypto/defaults.c: In function 'get_windows_regdirs':
crypto/defaults.c:72:5: error: unknown type name 'LPCTCH'; did you mean 'LPTCH'?
   72 |     LPCTCH tempstr = NULL;
      |     ^~~~~~
      |     LPTCH

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

(cherry picked from commit 0e38f78dca2ececcce4d0179b7d111452e7878ea)

4 months agocrypto: fix preprocessor concatenation
Hugo Beauzée-Luyssen [Mon, 27 Jan 2025 07:36:07 +0000 (08:36 +0100)] 
crypto: fix preprocessor concatenation

String litteral don't need the '##' operator, which causes build
failures:
crypto/defaults.c:kepi:23: error: pasting ""SOFTWARE\\WOW6432Node\\OpenSSL"" and ""-"" does not give a valid preprocessing token

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

(cherry picked from commit ed3876adb1f0beb5fac8d564337ab949f227c563)

4 months agoUpdate FIPS-README.md to reflect latest versions
Neil Horman [Thu, 27 Mar 2025 14:34:52 +0000 (10:34 -0400)] 
Update FIPS-README.md to reflect latest versions

With our new FIPS provider certification, lets update the FIPS-README to
reflect our latest release and fips validated versions

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

(cherry picked from commit 50316c18a0468bb0191904d7615955c9b47f061f)

4 months agoAvoid potential double-free with duplicated hybrid ML-KEM keys
Viktor Dukhovni [Thu, 27 Mar 2025 01:34:50 +0000 (12:34 +1100)] 
Avoid potential double-free with duplicated hybrid ML-KEM keys

Issue reported by Apple Inc on 2025-03-26.

Reviewed-by: Tim Hudson <tjh@openssl.org>
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/27173)

(cherry picked from commit 02cada2e45a2867e304542f9c5440bfb29af0283)

4 months agoadded use IO::File; to 15-test_ml_kem_codecs.t
Alex Prabhat Bara [Thu, 27 Mar 2025 10:12:07 +0000 (15:42 +0530)] 
added use IO::File; to 15-test_ml_kem_codecs.t

CLA: trivial

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

(cherry picked from commit 39229d93d53806fff98108f4bfdb228fef6546e3)

4 months agoadded use IO::File; 15-test_ml_dsa_codecs.t
Alex Prabhat Bara [Thu, 27 Mar 2025 10:11:31 +0000 (15:41 +0530)] 
added use IO::File; 15-test_ml_dsa_codecs.t

CLA: trivial

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

(cherry picked from commit 6a6ce4c1f3d3ceee77ad8787d9786d4af896b72d)

4 months agoapps/lib/apps.c: Add a check for OPENSSL_strdup()
JiashengJiang [Wed, 26 Mar 2025 21:40:16 +0000 (17:40 -0400)] 
apps/lib/apps.c: Add a check for OPENSSL_strdup()

Add a check for the return value of OPENSSL_strdup() to guarantee the success of allocation, similar to the other call sites.

Fixes: c7d5ea2670 ("Prepare to detect index changes in OCSP responder.")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27172)

(cherry picked from commit 930c645e6b74a09398f6345b2d265c38ff035afe)

4 months agoFix goto label indents to match style
Viktor Dukhovni [Thu, 27 Mar 2025 07:58:37 +0000 (18:58 +1100)] 
Fix goto label indents to match style

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

(cherry picked from commit 60f2a714002365256dba1c55bb4dd46802ea14d6)

4 months agoprovider-compatibility.yml: Update the branches
Tomas Mraz [Thu, 27 Mar 2025 11:11:57 +0000 (12:11 +0100)] 
provider-compatibility.yml: Update the branches

Fixes regression from 725f55e23

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

(cherry picked from commit bf4c9b7b663e03e81fe0291e03b814bafd409d1b)