]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
3 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)

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

3 months agoDisable stringop-overflow warnings on s390
Neil Horman [Thu, 3 Apr 2025 14:47:28 +0000 (10:47 -0400)] 
Disable stringop-overflow warnings on s390

Recently ci on master has been failing:
https://github.com/openssl/openssl/actions/runs/14234051502/job/39919663876

Its occuring because the s390 gcc compiler is complaining about various
functions attempting to write past the end of an array.

However, I can find no case in which we actually do so in this case.

The problem resolves when we either:
1) Disable the stringop-overflow warning
or
2) disable all loop unrolling optimizations with fno-loop-nest-optimize

Given that asan doesn't report any out of bounds errors on s390 when
built with case (1), and case (2) can be a significant performance hit,
coupled with the fact that gcc on any other platform avoids the same
issue (s390 is stuck on gcc 12, instead of gcc 16 where the other
platforms are), I think the right thing to do is just disable the
warning here

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27253)

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

3 months agoAdd a SBOM template in CycloneDX format
Richard Hughes [Thu, 21 Nov 2024 11:10:11 +0000 (11:10 +0000)] 
Add a SBOM template in CycloneDX format

Improve supply chain security by including a SBOM file with substituted values.

This will be used to construct a composite platform SBOM.

Signed-off-by: Richard Hughes <rhughes@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26020)

3 months agoEnable x86-64 SHA-512 family optimizations with SHA512 ISA extension
Stanciu, Adrian [Tue, 11 Feb 2025 21:14:55 +0000 (13:14 -0800)] 
Enable x86-64 SHA-512 family optimizations with SHA512 ISA extension
The SHA-256 (SZ=4) and SHA-512 (SZ=8) dispatcher paths have been
separated while keeping the SHA-256 path unmodified.

Due to early constraints in register availability, two 32-bit
`OPENSSL_ia32cap_P` reads have been coalesced into one. As a
consequence, several bit positions used in feature checks have gained a
32 bits offset.

Replaced `test` with `bt` to allow use of 64-bit immediate indices in
CPUID feature checks.

Split the SHA512 BMI2+AVX2+BMI1 dispatcher branch into:
- AVX2+SHA512: high priority, with SHA512 ISA extension
- AVX2+BMI2+BMI1: fallback

The added implementation has its own copy of `K512` without duplicated
elements every 16 bytes. Shuffle indices have been reused from `K512`.

Added binary translators for `vsha512msg1`, `vsha512msg2`,
`vsha512rnds2` for older assemblers.

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

3 months agoEnable x86-64 SM3 optimizations with SM3 ISA extension
Elizarova, Alina [Tue, 11 Feb 2025 14:10:00 +0000 (06:10 -0800)] 
Enable x86-64 SM3 optimizations with SM3 ISA extension

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

3 months agoEnable x86-64 SM4 optimizations with SM4 ISA extension
Elizarova Alina [Tue, 1 Apr 2025 10:40:40 +0000 (03:40 -0700)] 
Enable x86-64 SM4 optimizations with SM4 ISA extension

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

3 months agoFix a visual glitch in test_cmp_http.t 26979/head
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)

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

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

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

3 months agotest/tls-provider.c: Remove redundant check
JiashengJiang [Tue, 1 Apr 2025 01:42:38 +0000 (21:42 -0400)] 
test/tls-provider.c: Remove redundant check

Remove "if (key != NULL)" since there is already a check before.

CLA: trivial
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27220)

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)

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)

4 months agomove BIO_err_is_non_fatal() to bio_lib.c
dare3path [Fri, 28 Mar 2025 06:54:55 +0000 (07:54 +0100)] 
move BIO_err_is_non_fatal() to bio_lib.c

done this without running mkerr.pl otherwise
this is what mkerr.pl would do:
* remove BIO_err_is_non_fatal from bio_err.c
* remove duplicate BIO_R_PORT_MISMATCH
* reorder/sort 3 things
* update copyright year from 2022 to 2025

see #27183

CLA: trivial

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

4 months agoupdate rust toolchain
Neil Horman [Fri, 28 Mar 2025 14:19:56 +0000 (10:19 -0400)] 
update rust toolchain

Needs update to build new rust crate for pyca-cryptography

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

4 months agoFix up external pyca test
Neil Horman [Fri, 28 Mar 2025 11:51:02 +0000 (07:51 -0400)] 
Fix up external pyca test

The latest version of pyca-cryptography no longer has a setup.py script,
so change the check in the test to look for release.py instead

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

4 months agoupdate pyca-cryptography to latest master
Neil Horman [Fri, 28 Mar 2025 11:58:49 +0000 (07:58 -0400)] 
update pyca-cryptography to latest master

Was going to update to latest tagged release, but there are some python
errors that need the latest fixes to avoid some invalid dict hashing

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

4 months agoupdate wycheproof submodule to latest master
Neil Horman [Fri, 28 Mar 2025 11:50:12 +0000 (07:50 -0400)] 
update wycheproof submodule to latest master

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

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)

4 months agoci: strict warnings the default
Pauli [Mon, 31 Mar 2025 01:30:45 +0000 (12:30 +1100)] 
ci: strict warnings the default

Make building with --strict-warnings the default for most builds.
Move this option to immediately after the ./config command so its presence
is clearer.

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

4 months agorand: avoid unused function warning for FreeBSD and NetBSD.
Pauli [Mon, 31 Mar 2025 02:01:22 +0000 (13:01 +1100)] 
rand: avoid unused function warning for FreeBSD and NetBSD.

The existing checks were not sufficiently version specific.

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

4 months agoci: remove unnecessary -Wall and -Werror options
Pauli [Mon, 31 Mar 2025 01:18:01 +0000 (12:18 +1100)] 
ci: remove unnecessary -Wall and -Werror options

The oprion --strict-warnings automatically turns on -Wall and -Werror so there
is no requirement to specify the latter two separately.

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

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

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)

4 months agoRISC-V: Provide optimized SHA-256 implementation using Zbb extension
Julian Zhu [Thu, 27 Feb 2025 08:55:53 +0000 (16:55 +0800)] 
RISC-V: Provide optimized SHA-256 implementation using Zbb extension

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27011)

4 months agoRISC-V: Provide optimized SHA-512 implementation using Zbb extension
Julian Zhu [Thu, 27 Feb 2025 09:10:18 +0000 (17:10 +0800)] 
RISC-V: Provide optimized SHA-512 implementation using Zbb extension

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27161)

4 months agoRISC-V: Add Zbb rori opcode in riscv.pm
Julian Zhu [Thu, 27 Feb 2025 09:08:39 +0000 (17:08 +0800)] 
RISC-V: Add Zbb rori opcode in riscv.pm

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27161)

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)

4 months agoFix quic_multistream_test: correct more frame types
Bernd Edlinger [Tue, 25 Mar 2025 15:57:32 +0000 (16:57 +0100)] 
Fix quic_multistream_test: correct more frame types

There are a few more critical frame injections that
previously created an out-of-diskspace problem
and now only a CI test failure.  The pattern
in the qlog files is always similar to this:

{"frame_type":"stop_sending","stream_id":6,"error_code":1152,"length":4},
{"frame_type":"path_challenge","length":9},...{}

Note: The stream_id 6 is a OSSL_QUIC_FRAME_TYPE_CRYPTO.

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

4 months agoUse OPENSSL_strdup() for strings freed by OPENSSL_free()
sashan [Wed, 26 Mar 2025 08:37:01 +0000 (09:37 +0100)] 
Use OPENSSL_strdup() for strings freed by OPENSSL_free()

Things can get messy when application decides to use it's own memory
allocation functions using CRYPTO_set_mem_functions(3ossl)

Reviewed-by: Richard Levitte <levitte@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/27163)

4 months agoport_init(): Security hardening for token key
Andrew Ioanoviciu [Tue, 11 Mar 2025 15:17:11 +0000 (11:17 -0400)] 
port_init(): Security hardening for token key

Used RAND_priv_bytes_ex instead of RAND_bytes_ex to guarantee higher isolation
for cryptographic keys.

Replaced OPENSSL_free with OPENSSL_clear_free to wipe sensitive data and free
it.

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

4 months agoReport s_client chain cert pkey alg correctly
Viktor Dukhovni [Sun, 23 Mar 2025 13:50:39 +0000 (00:50 +1100)] 
Report s_client chain cert pkey alg correctly

In particular provided keys are also supported, and for EC keys we
report the group rather than the bit count.

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

4 months agoUpdate X509_VERIFY_PARAM_set_flags.pod
Kyle Mullen [Tue, 18 Mar 2025 13:29:25 +0000 (09:29 -0400)] 
Update X509_VERIFY_PARAM_set_flags.pod

Change description of B<X509_V_FLAG_CRL_CHECK_ALL> to reflect its inability
to function without B<X509_V_FLAG_CRL_CHECK> being enabled as well.

Fixes #27056 (https://github.com/openssl/openssl/issues/27056)

CLA: trivial

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

4 months agoExtend backoff period in noisydgram BIO users
Neil Horman [Wed, 26 Mar 2025 15:17:31 +0000 (11:17 -0400)] 
Extend backoff period in noisydgram BIO users

Initially tests that were written which make use of the noisy dgram BIO,
were done under the assumption that, despite any packet mangling done by
the noisy dgram bio, the connection would still be established.  This
was initiall guaranteed by configuring the BIO to avoid
corrupting/dropping/duplicating/re-injecting the first packet received,
thus ensuring that the client and server hello frames would make it to
the peer successfully.

This implicitly made the assumption that the client and server hellos
were contained within a single datagram, which until recently was true.

However, with the introduction of ML-KEM keyshares, the above assumption
no longer holds.  Large ML-KEM keyshares generally expand these TLS
messages accross multiple datagrams, and so it is now possible that
those initial records can become corrupted/lost etc, leading to
unexpected connection failures.

Lets fix it by restoring the guarantee that these tests were written
under by making the backoff time configurable to a number of frames, and
configuring the quic connection objects used in the test to not drop the
first two initial frames, once again guaranteeing that the client and
server hello arrive at the peer uncorrupted, so that we get a good
connection established.

Fixes #27103

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

4 months agobn_mul_words.pod: Fix failures in doc-nits check
qu3ri [Tue, 4 Feb 2025 14:05:02 +0000 (09:05 -0500)] 
bn_mul_words.pod: Fix failures in doc-nits check

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26597)

4 months agoMoved crypto/bn/README.pod to internal manpages
qu3ri [Thu, 30 Jan 2025 19:04:59 +0000 (14:04 -0500)] 
Moved crypto/bn/README.pod to internal manpages

The new place is doc/internal/man3/bn_mul_words.pod.

Also removed outdated information.

Implementing the fix from https://github.com/quictls/quictls/pull/214

Fixes #26399

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26597)

4 months agoUpdate dead links and e-mails our sources
Neil Horman [Sun, 16 Mar 2025 15:34:14 +0000 (11:34 -0400)] 
Update dead links and e-mails our sources

http://www.openssl.org/~appro/cryptogams/ is 404, update to
https://github.com/dot-asm/cryptogams/

And clean up the boiler plate text around it.

Replace stray usage of appro@openssl.org with github url. The email in
question here is no longer valid, replace it with the corresponding
github id for the user.

Replace <appro\@fy.chalmers.se> with <https://github.com/dot-asm>

Fix lots more dead emails addresses that we missed

Remove reference urls that no longer exist. Just delete urls that
404 now, and have no obvious new link.

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

4 months agoRemoved duplicates in some man pages
Chase Killorin [Wed, 5 Mar 2025 19:44:58 +0000 (14:44 -0500)] 
Removed duplicates in some man pages

Fixes openssl/openssl#11748

find-doc-nits: Check for duplicate options

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27088)

4 months agoFix return value of the i2d_ASN1_bio_stream() call
Andrey Tsygunka [Thu, 20 Mar 2025 14:45:23 +0000 (17:45 +0300)] 
Fix return value of the i2d_ASN1_bio_stream() call

If the flags argument does not contain the SMIME_STREAM bit,
the i2d_ASN1_bio_stream() function always returns 1,
ignoring the result of the ASN1_item_i2d_bio() call.

Fix the return value to the result of the ASN1_item_i2d_bio()
call for this case.

CLA: trivial

Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27106)

4 months agoIn s_client report 'long' certificate sigalg name
Viktor Dukhovni [Sun, 23 Mar 2025 13:29:38 +0000 (00:29 +1100)] 
In s_client report 'long' certificate sigalg name

This matches the sigalg output format of X509_signature_print(3).

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

4 months agoUpdate provider compatibility CI to run on 3.5 branch
Tomas Mraz [Tue, 25 Mar 2025 09:16:30 +0000 (10:16 +0100)] 
Update provider compatibility CI to run on 3.5 branch

Also drop 3.1 development branch as it is out of public support now.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27149)

4 months agoIn doc/man7/provider-{en,de}coder.pod, clarify where properties are defined
Richard Levitte [Mon, 24 Mar 2025 05:25:01 +0000 (06:25 +0100)] 
In doc/man7/provider-{en,de}coder.pod, clarify where properties are defined

Fixes #27126

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27132)

4 months agoFix a visual glitch in test_cms.t
Bernd Edlinger [Mon, 24 Mar 2025 22:03:16 +0000 (23:03 +0100)] 
Fix a visual glitch in test_cms.t

the newline in the newly added subtest names somehow
creates another small visual glitch in the test output,
that looks like:
80-test_cms.t .. 30/?
80-test_cms.t .. ok

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

4 months agoChange documentation to point to new wiki location
Jon Ericson [Fri, 14 Mar 2025 16:44:55 +0000 (09:44 -0700)] 
Change documentation to point to new wiki location

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

4 months agoMemory leak fix ktls_meth.c
jay9827342 [Fri, 21 Mar 2025 09:39:49 +0000 (09:39 +0000)] 
Memory leak fix ktls_meth.c

The OSSL_RECORD_LAYER needs to be properly freed when return code isnt success.
Memory leak fix

CLA: trivial

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

4 months agoEnable AES-GCM unroll8/unroll12 for Neoverse N3/V3
Paul Elliott [Fri, 28 Feb 2025 17:39:50 +0000 (17:39 +0000)] 
Enable AES-GCM unroll8/unroll12 for Neoverse N3/V3

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

4 months agoReport IANA sigalg name in s_client
Viktor Dukhovni [Sun, 23 Mar 2025 07:50:39 +0000 (18:50 +1100)] 
Report IANA sigalg name in s_client

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

4 months agoTest EVP_DigestSignInit() with ECDSA and KECCAK-256 hash
Tomas Mraz [Thu, 20 Mar 2025 20:25:07 +0000 (21:25 +0100)] 
Test EVP_DigestSignInit() with ECDSA and KECCAK-256 hash

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27107)

4 months agoAllow ECDSA signing with digests without a NID in default provider
Tomas Mraz [Thu, 20 Mar 2025 19:47:54 +0000 (20:47 +0100)] 
Allow ECDSA signing with digests without a NID in default provider

Also fix ineffective check in DSA signing.

Fixes #27084

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27107)

4 months agoFix NULL pointer dereference in `asn1_ex_i2c()`, crypto/asn1/tasn_enc.c
Andrey Tsygunka [Wed, 19 Mar 2025 11:53:02 +0000 (14:53 +0300)] 
Fix NULL pointer dereference in `asn1_ex_i2c()`, crypto/asn1/tasn_enc.c

Adds handling of V_ASN1_UNDEF to avoid NULL dereference
in case ASN1 structure contains an element of type ASN1_TYPE
without initializing its value (i.e. default constructed)

CLA: trivial

Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27100)

4 months agoUpdate NEWS.md and CHANGES.md for the 3.5 release
Tomas Mraz [Tue, 25 Mar 2025 14:19:05 +0000 (15:19 +0100)] 
Update NEWS.md and CHANGES.md for the 3.5 release

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

(cherry picked from commit d6ace599edfba7f1487725993531578bfeb9663a)

4 months ago80-test_cms.t: Fix Provider compatibility CI failures
Tomas Mraz [Tue, 25 Mar 2025 09:17:36 +0000 (10:17 +0100)] 
80-test_cms.t: Fix Provider compatibility CI failures

Old FIPS providers do not support PQC algorithms.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27147)

4 months agoTry to fix endless loops in quic_multistream_test
Bernd Edlinger [Sun, 23 Mar 2025 14:20:34 +0000 (15:20 +0100)] 
Try to fix endless loops in quic_multistream_test

The problem seem to be caused by syntax errors due to injected
OSSL_QUIC_FRAME_TYPE_PATH_CHALLENGE packets which are too short
by 8 bytes.

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

4 months agoUpload artifacts despite possible test failures
Bernd Edlinger [Fri, 21 Mar 2025 16:34:24 +0000 (17:34 +0100)] 
Upload artifacts despite possible test failures

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

4 months agoDo not wrap the python3 in ../../util/wrap.pl
Bernd Edlinger [Thu, 20 Mar 2025 18:45:17 +0000 (19:45 +0100)] 
Do not wrap the python3 in ../../util/wrap.pl

That is bad, because this script does seem to have issues,
because it is itself linked against libcrypto, which causes
crashes in enable-asan builds:

ASan runtime does not come first in initial library list;
you should either link runtime to your application or manually
preload it with LD_PRELOAD.
../../util/wrap.pl python3 ../../test/recipes/70-test_quic_multistream_data/verify-qlog.py => 1
    not ok 1 - running qlog verification script
not ok 2 - check qlog output

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

4 months agoTry to fix reported qlog issues
Bernd Edlinger [Thu, 20 Mar 2025 16:14:51 +0000 (17:14 +0100)] 
Try to fix reported qlog issues

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

4 months agoAdds the concept of thunks to OPENSSL_sk interface
Frederik Wedel-Heinen [Sat, 15 Mar 2025 20:02:54 +0000 (21:02 +0100)] 
Adds the concept of thunks to OPENSSL_sk interface

This allows applications to call functions of correct signature when free'ing OPENSSL_sk items which UBSan complains about.
Related to #22896.

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

4 months agoqlog_event_helpers.c: Fix inverted condition
Tomas Mraz [Mon, 24 Mar 2025 09:53:02 +0000 (10:53 +0100)] 
qlog_event_helpers.c: Fix inverted condition

We want to skip up to PACKET_remaining() and not "at least"
PACKET_remaining() bytes.

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

4 months agoML_DSA - Fix bug in OSSL_PKEY_PARAM_SECURITY_BITS getter.
slontis [Fri, 21 Mar 2025 04:46:52 +0000 (15:46 +1100)] 
ML_DSA - Fix bug in OSSL_PKEY_PARAM_SECURITY_BITS getter.

Reported by @romen

It was off by a factor of 8.

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

4 months agoMove the Handshake read secret change earlier in the process for QUIC 0-RTT 26860/head
Matt Caswell [Wed, 19 Mar 2025 15:18:06 +0000 (15:18 +0000)] 
Move the Handshake read secret change earlier in the process for QUIC 0-RTT

On the server side we were changing the handshake rx secret a little late.
This meant the application was forced to call SSL_do_handshake() again
even if there was nothing to read in order to get the secret. We move it
a little earlier int the process to avoid this.

Fixes the issue described in:
https://github.com/ngtcp2/ngtcp2/pull/1582#issuecomment-2735950083

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

4 months agoFix use of SHAKE as a digest in CMS
Daniel Van Geest [Tue, 18 Mar 2025 12:56:53 +0000 (12:56 +0000)] 
Fix use of SHAKE as a digest in CMS

draft-ietf-lamps-cms-sphincs-plus-19 specifies SHAKE as
the message digest algorithm for SLH-DSA-SHAKE-* in CMS.
SHAKE doesn't have a default digest length, so this adds
a SHAKE-specific kludge in CMS.

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

4 months agoAvoid erroneous legacy code path when provided
Viktor Dukhovni [Mon, 17 Mar 2025 03:08:52 +0000 (14:08 +1100)] 
Avoid erroneous legacy code path when provided

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

4 months agoapps/cms.c, apps/ocsp.c: Added NULL pointer checks
Ankit Kekre [Thu, 13 Mar 2025 15:59:54 +0000 (21:29 +0530)] 
apps/cms.c, apps/ocsp.c: Added NULL pointer checks

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

4 months agoFix the use of CCM ciphersuites with QUIC TLS API
Matt Caswell [Tue, 18 Mar 2025 14:36:28 +0000 (14:36 +0000)] 
Fix the use of CCM ciphersuites with QUIC TLS API

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

4 months agoAdd a test for using CCM ciphersuites with QUIC TLS API
Matt Caswell [Tue, 18 Mar 2025 14:36:14 +0000 (14:36 +0000)] 
Add a test for using CCM ciphersuites with QUIC TLS API

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

4 months agoAlways use NULL BIOs when using the QUIC TLS API
Matt Caswell [Tue, 18 Mar 2025 12:51:29 +0000 (12:51 +0000)] 
Always use NULL BIOs when using the QUIC TLS API

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

4 months agoTest that using the QUIC TLS API does not require BIOs to be set
Matt Caswell [Tue, 18 Mar 2025 12:49:48 +0000 (12:49 +0000)] 
Test that using the QUIC TLS API does not require BIOs to be set

When using the QUIC TLS API it does not make sense to require BIOs to be
set.

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

4 months agoEnsure SSL_get_app_data() continues to work even in SSL_free()
Matt Caswell [Tue, 18 Mar 2025 12:10:59 +0000 (12:10 +0000)] 
Ensure SSL_get_app_data() continues to work even in SSL_free()

During SSL_free() we may get a QUIC TLS callback being called to clean up
any remaining record data. We should ensure that SSL_get_app_data()
continues to work, even in this scenario.

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

4 months agoDon't decrement the unreleased counter if we failed to release a record
Matt Caswell [Tue, 18 Mar 2025 12:05:08 +0000 (12:05 +0000)] 
Don't decrement the unreleased counter if we failed to release a record

In a failure situation we may incorrectly decrement the amount of data
released. Only decrement the counter if we successfully released.

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

4 months agoCheck SSL_get_app_data() from QUIC cb in a failure situation
Matt Caswell [Tue, 18 Mar 2025 12:04:15 +0000 (12:04 +0000)] 
Check SSL_get_app_data() from QUIC cb in a failure situation

Ensure SSL_get_app_data() works even in a failure situation from SSL_free()

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

4 months agoAdd a test for calling SSL_get_app_data() from QUIC TLS callbacks
Matt Caswell [Tue, 18 Mar 2025 11:36:01 +0000 (11:36 +0000)] 
Add a test for calling SSL_get_app_data() from QUIC TLS callbacks

Check that we get the expected app data when using the QUIC TLS callbacks.

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

4 months agoRemove workaround for an old ppc64le compiler bug
Bernd Edlinger [Tue, 11 Mar 2025 17:58:25 +0000 (18:58 +0100)] 
Remove workaround for an old ppc64le compiler bug

Lowering the optimization level is no longer needed,
since the old compiler bug from ubuntu-20.04 has been
fixed meanwhile.

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

4 months agocorrectly mark the release as prerelease
Dmitry Misharov [Tue, 18 Mar 2025 16:11:40 +0000 (17:11 +0100)] 
correctly mark the release as prerelease

release must be marked as prerelease if "alpha" or "beta" is in tag name

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

4 months agoTolerate PKCS#8 V2 with optional public keys
Viktor Dukhovni [Mon, 17 Mar 2025 04:24:33 +0000 (15:24 +1100)] 
Tolerate PKCS#8 V2 with optional public keys

- Presently any included public key is unused.
- We don't check that v1 PKCS#8 structures omit the public key.

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

4 months agoUse text compare for PEM and text files
Jon Spillett [Tue, 18 Mar 2025 03:37:15 +0000 (13:37 +1000)] 
Use text compare for PEM and text files

- Fix ml_dsa_codecs test
- Fix ml_kem_codecs test
- Fix pkey test
- Fix dsaparam test
- Fix dhparam test
- Fix pkcs8 test

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
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/27082)

4 months agoDoc fix in EVP_PKEY-ML-DSA/KEM.pod files
Ingo Franzki [Mon, 17 Mar 2025 08:57:40 +0000 (09:57 +0100)] 
Doc fix in EVP_PKEY-ML-DSA/KEM.pod files

Fix the references to OSSL_PROVIDER_add_conf_parameter in the 'SEE ALSO'
section.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27077)

4 months agoFix gettable_params() for ECX
Martin Oliveira [Wed, 12 Mar 2025 17:09:04 +0000 (11:09 -0600)] 
Fix gettable_params() for ECX

The OSSL_PKEY_PARAM_MANDATORY_DIGEST parameter is only handled by the
ed25519_get_params() and ed448_get_params(). The x25519 and x448
versions of get_params() always ignore that parameter, so it should not
be in the list of gettable params.

Fixes: 1a7328c88256 ("PROV: Ensure that ED25519 & ED448 keys have a mandatory digest")
cla: trivial

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

4 months agoFix missing OSSL_FUNC_DIGEST_GET_PARAMS in provider-digest.pod
ak4153 [Sat, 8 Mar 2025 19:37:59 +0000 (21:37 +0200)] 
Fix missing OSSL_FUNC_DIGEST_GET_PARAMS in provider-digest.pod

Fixes #26626
CLA: trivial

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

4 months agorequire GNU assembler 2.30 or higher to build aesni-xtx-avx512.pl
sashan [Mon, 17 Mar 2025 09:23:19 +0000 (10:23 +0100)] 
require GNU assembler 2.30 or higher to build aesni-xtx-avx512.pl

The peralsm in aesni-xts-avx512 currently checks for GNU assembler 2.26
or higher. According to reporters it looks like we need 2.30.

This PR just attempts fix version check so people with older
tool chains can  build OpenSSL.

Fixes #27049

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27078)

4 months agodocs(provider-base): Add HISTORY note for OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS (and...
Nicola Tuveri [Fri, 14 Mar 2025 12:09:10 +0000 (14:09 +0200)] 
docs(provider-base): Add HISTORY note for OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS (and MAX)

This commit adds a small note about
definitions for
`OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS` and
`OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS`
being first added in OpenSSL 3.5.

PR #26975 added these definitions for OpenSSL 3.5, but the documentation
update omitted a history note for the addition.

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

4 months agoDo some more cleanup in the RCU code
Bernd Edlinger [Sun, 9 Mar 2025 10:20:43 +0000 (11:20 +0100)] 
Do some more cleanup in the RCU code

Only a minimum of 2 qp's are necessary: one for the readers,
and at least one that writers can wait on for retirement.
There is no need for one additional qp that is always unused.
Also only one ACQUIRE barrier is necessary in get_hold_current_qp,
so the ATOMIC_LOAD of the reader_idx can be changed to RELAXED.
And finally clarify some comments.

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

4 months agoFix a memory order issue with weakly ordered systems
Bernd Edlinger [Mon, 3 Mar 2025 22:46:12 +0000 (23:46 +0100)] 
Fix a memory order issue with weakly ordered systems

this adds a dummy atomic release operation to update_qp, which
should make sure that the new value of reader_idx is visible in
get_hold_current_qp, directly after incrementing the users count.

Fixes: #26875
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26964)

4 months agoFix interop ci yaml
Neil Horman [Fri, 14 Mar 2025 20:08:04 +0000 (16:08 -0400)] 
Fix interop ci yaml

Somehow I mistakenly listed clients in the exlude list, when it should
have been servers, resulting in an invalid yml file

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

4 months agoFix Minerva timing side-channel signal for P-384 curve on PPC
Danny Tsen [Tue, 11 Feb 2025 18:48:01 +0000 (13:48 -0500)] 
Fix Minerva timing side-channel signal for P-384 curve on PPC

1. bn_ppc.c: Used bn_mul_mont_int() instead of bn_mul_mont_300_fixed_n6()
   for Montgomery multiplication.
2. ecp_nistp384-ppc64.pl:
   - Re-wrote p384_felem_mul and p384_felem_square for easier maintenance with
     minumum perl wrapper.
   - Implemented p384_felem_reduce, p384_felem_mul_reduce and p384_felem_square_reduce.
   - Implemented p384_felem_diff64, felem_diff_128_64 and felem_diff128 in assembly.
3. ecp_nistp384.c:
   - Added wrapper function for p384_felem_mul_reduce and p384_felem_square_reduce.

Signed-off-by: Danny Tsen <dtsen@us.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26709)

4 months agoWrap use of poll.h to prevent including on NonStop.
Randall S. Becker [Wed, 12 Feb 2025 14:40:59 +0000 (14:40 +0000)] 
Wrap use of poll.h to prevent including on NonStop.

Fixes: #26724
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26726)