]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
20 months agoFix a possible use after free in X509v3_asid_add_id_or_range
Bernd Edlinger [Wed, 15 Nov 2023 19:49:51 +0000 (20:49 +0100)] 
Fix a possible use after free in X509v3_asid_add_id_or_range

And clean up partially created choice objects, which have
still the default type = -1 from ASIdentifierChoice_new().

Fixes #22700

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22745)

20 months agorsa-doc: fix typo
James Muir [Wed, 29 Nov 2023 17:37:44 +0000 (12:37 -0500)] 
rsa-doc: fix typo

"d_i in RFC8017" -> "d_i" in RFC8017

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22868)

20 months agodoc: Minor typo in SSL_CTX_set_tmp_dh_callback docs.
Sean Bright [Mon, 20 Nov 2023 20:08:19 +0000 (15:08 -0500)] 
doc: Minor typo in SSL_CTX_set_tmp_dh_callback docs.

well know -> well known

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22778)

20 months agoInitialize dstctx->mgf1_md to NULL in rsa_dupctx function
lan1120 [Wed, 22 Nov 2023 01:45:25 +0000 (09:45 +0800)] 
Initialize dstctx->mgf1_md to NULL in rsa_dupctx function

Signed-off-by: lan1120 <lanming@huawei.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22795)

20 months agobn_nist: Fix strict-aliasing violations in little-endian optimizations
Xi Ruoyao [Sat, 25 Nov 2023 08:14:35 +0000 (16:14 +0800)] 
bn_nist: Fix strict-aliasing violations in little-endian optimizations

The little-endian optimization is doing some type-punning in a way
violating the C standard aliasing rule by loading or storing through a
lvalue with type "unsigned int" but the memory location has effective
type "unsigned long" or "unsigned long long" (BN_ULONG).  Convert these
accesses to use memcpy instead, as memcpy is defined as-is "accessing
through the lvalues with type char" and char is aliasing with all types.

GCC does a good job to optimize away the temporary copies introduced
with the change.  Ideally copying to a temporary unsigned int array,
doing the calculation, and then copying back to `r_d` will make the code
look better, but unfortunately GCC would fail to optimize away this
temporary array then.

I've not touched the LE optimization in BN_nist_mod_224 because it's
guarded by BN_BITS2!=64, then BN_BITS2 must be 32 and BN_ULONG must be
unsigned int, thus there is no aliasing issue in BN_nist_mod_224.

Fixes #12247.

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

20 months agoFix implementation of `PreferNoDHEKEX` option.
Markus Minichmayr [Mon, 27 Nov 2023 17:26:51 +0000 (18:26 +0100)] 
Fix implementation of `PreferNoDHEKEX` option.

`tls_parse_ctos_key_share()` didn't properly handle the option.
Avoid the need to deal with the option in multiple places by properly
handling it in `tls_parse_ctos_psk_kex_modes()`.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22844)

20 months agoFix EVP_RAND-SEED-SRC documentation example
Jamie Cui [Wed, 29 Nov 2023 01:28:58 +0000 (01:28 +0000)] 
Fix EVP_RAND-SEED-SRC documentation example

Fixes #22810

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

20 months agoAdd self-hosted runners
Dmitry Misharov [Thu, 23 Nov 2023 13:22:35 +0000 (14:22 +0100)] 
Add self-hosted runners

Added self-hosted runners for freebsd-x86_64 and ubuntu-aarch64.

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

20 months agoOptimize AES-CTR for ARM Neoverse V1 and V2.
fisher.yu [Tue, 17 Oct 2023 08:10:34 +0000 (08:10 +0000)] 
Optimize AES-CTR for ARM Neoverse V1 and V2.

    Unroll AES-CTR loops to a maximum 12 blocks for ARM Neoverse V1 and
    V2, to fully utilize their AES pipeline resources.

    Improvement on ARM Neoverse V1.

    Package Size(Bytes) 16 32 64 128 256 1024
    Improvement(%) 3.93 -0.45 11.30 4.31 12.48 37.66
    Package Size(Bytes) 1500 8192 16384 61440 65536
    Improvement(%) 37.16 38.90 39.89 40.55 40.41

Change-Id: Ifb8fad9af22476259b9ba75132bc3d8010a7fdbd

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

20 months agoAdd last missing TLSA usage/selector/mtype test case
Viktor Dukhovni [Mon, 27 Nov 2023 16:23:54 +0000 (11:23 -0500)] 
Add last missing TLSA usage/selector/mtype test case

There were no PKIX-TA(0) SPKI(1) Full(0) (i.e. "0 1 0") test cases in
"danetest.in".

There is now at least a success case, which will exercise freeing the public
key after it is sanity checked, since with PKIX-TA(0) there's nothing we can do
with just the raw public key, a full chain to a local trust anchor is in any
case required.

The failure (to match) code path is already well oiled, but failure to decode
while adding malfored TLSA records could still use some additional tests...

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22821)

20 months agoFix freshly introduced double-free.
Viktor Dukhovni [Sat, 25 Nov 2023 18:26:20 +0000 (13:26 -0500)] 
Fix freshly introduced double-free.

We don't need the decoded X.509 Full(0) certificate for the EE usages 1 and 3,
because the leaf certificate is always part of the presented chain, so the
certificate is only validated as well-formed, and then discarded, but the
TLSA record is of course still used after the validation step.

Added DANE test cases for: 3 0 0, 3 1 0, 1 0 0, and 1 1 0

Reported by Claus Assmann.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22821)

20 months agoRemove mention of NEWS.md in CONTRIBUTING.md
Hugo Landau [Tue, 21 Nov 2023 12:53:12 +0000 (12:53 +0000)] 
Remove mention of NEWS.md in CONTRIBUTING.md

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

20 months agoAdd known issues section
Hugo Landau [Tue, 21 Nov 2023 12:52:56 +0000 (12:52 +0000)] 
Add known issues section

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

20 months agoAdd proposed editorial conventions for NEWS.md
Hugo Landau [Mon, 20 Nov 2023 14:54:10 +0000 (14:54 +0000)] 
Add proposed editorial conventions for NEWS.md

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

20 months agoFix a possible memory leak in ct_move_scts
Bernd Edlinger [Fri, 17 Nov 2023 13:47:36 +0000 (14:47 +0100)] 
Fix a possible memory leak in ct_move_scts

Instead of trying to move the doomed sct back
to the src stack, which may fail as well, simply
free the sct object, as the src list will be
deleted anyway.

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

20 months agoDo not define L_ENDIAN (for now) when we guessed linux64-loongarch64
Xi Ruoyao [Fri, 24 Nov 2023 08:14:05 +0000 (16:14 +0800)] 
Do not define L_ENDIAN (for now) when we guessed linux64-loongarch64

In 160f48941d14 I made L_ENDIAN defined when the system is guessed to be
linux64-loongarch64.  Unfortunately now I found it problematic:

1. This should be added into Configurations/10-main.conf, not here.
   Having it here causes a different configuration when
   linux64-loongarch64 is explicitly specified than guessed.
2. With LTO enabled, this causes many test failures on
   linux64-loongarch64 due to #12247.

So I think we should remove it for now (master and 3.2 branch), and
reintroduce it to Configurations/10-main.conf when we finally sort
out #12247.

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

20 months agoQUIC TSERVER: Fix erroneously static variable
Hugo Landau [Mon, 27 Nov 2023 07:57:32 +0000 (07:57 +0000)] 
QUIC TSERVER: Fix erroneously static variable

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

20 months agoMake scsv read-only
Hugo Landau [Mon, 27 Nov 2023 07:55:55 +0000 (07:55 +0000)] 
Make scsv read-only

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

20 months agoMake nid_to_group read-only
Hugo Landau [Mon, 27 Nov 2023 07:52:54 +0000 (07:52 +0000)] 
Make nid_to_group read-only

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

20 months agoMake bitmask table read only
Hugo Landau [Mon, 27 Nov 2023 07:52:24 +0000 (07:52 +0000)] 
Make bitmask table read only

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

20 months agoMake ssl_cert_info read-only
Hugo Landau [Mon, 27 Nov 2023 07:51:33 +0000 (07:51 +0000)] 
Make ssl_cert_info read-only

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

20 months agoOnly include winsock2.h for struct timeval if needed
Hugo Landau [Fri, 24 Nov 2023 10:03:30 +0000 (10:03 +0000)] 
Only include winsock2.h for struct timeval if needed

Fixes #22811

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/22813)

(cherry picked from commit ba58e9f1e22dd9ee2e37078640dcbe9f520a555d)

20 months agoQUIC SRT GEN: Minor updates
Hugo Landau [Thu, 23 Nov 2023 15:50:03 +0000 (15:50 +0000)] 
QUIC SRT GEN: Minor updates

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

20 months agoQUIC SRT GEN: Add SRT generator
Hugo Landau [Thu, 2 Nov 2023 15:41:23 +0000 (15:41 +0000)] 
QUIC SRT GEN: Add SRT generator

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

20 months agox86_64-xlate.pl: Fix build with icx and nvc compilers
Tomas Mraz [Mon, 13 Nov 2023 11:17:43 +0000 (12:17 +0100)] 
x86_64-xlate.pl: Fix build with icx and nvc compilers

Fixes #22594

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22714)

20 months agoPreferNoDHEKEX changelog and history anticipating inclusion in OpenSSL version 3.3.
Markus Minichmayr [Wed, 22 Nov 2023 16:43:27 +0000 (17:43 +0100)] 
PreferNoDHEKEX changelog and history anticipating inclusion in OpenSSL version 3.3.

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

20 months agoDocument `SSL_OP_PREFER_NO_DHE_KEX` option.
Markus Minichmayr [Tue, 21 Nov 2023 22:50:54 +0000 (23:50 +0100)] 
Document `SSL_OP_PREFER_NO_DHE_KEX` option.

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

20 months agoAdd option `SSL_OP_PREFER_NO_DHE_KEX`, allowing the server to prefer non-dhe psk...
Markus Minichmayr [Tue, 21 Nov 2023 19:42:12 +0000 (20:42 +0100)] 
Add option `SSL_OP_PREFER_NO_DHE_KEX`, allowing the server to prefer non-dhe psk key exchange over psk with dhe (config file option `PreferNoDHEKEX`, server option `prefer_no_dhe_kex`).

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

20 months agoWhen abidiff fails print out the XML diff
Tomas Mraz [Fri, 10 Nov 2023 15:06:16 +0000 (16:06 +0100)] 
When abidiff fails print out the XML diff

This can be useful for fixing the CI if needed
without the necessity to run abidw locally.

Also rename the CI job to make its purpose clearer.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22689)

20 months agoopenssl-speed: support KMAC128 & KMAC256, refactor mac setup/teardown
James Muir [Fri, 17 Nov 2023 23:02:51 +0000 (18:02 -0500)] 
openssl-speed: support KMAC128 & KMAC256, refactor mac setup/teardown

Add ability to measure performance of the two kmac algorithms, and
reduce code duplication in mac testing by introducing mac_setup() and
mac_teardown().  Also, start accepting "cmac" as an algorithm string
(similar to how "hmac" is accepted).

We can now compare the performance of KMAC128, KMAC256 (mac algs) to
KECCAK-KMAC128, KECCAK-KMAC256 (digest/xof algs).

Fixes #22619

Testing:

  $ LD_LIBRARY_PATH=. ./apps/openssl speed kmac cmac hmac

  $ LD_LIBRARY_PATH=. ./apps/openssl speed kmac256
  $ LD_LIBRARY_PATH=. ./apps/openssl speed -evp KECCAK-KMAC256

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

20 months agoIANA has assigned numbers for 2 hybrid PQ KEX widely used in tests
Dmitry Belyavskiy [Thu, 23 Nov 2023 09:22:36 +0000 (10:22 +0100)] 
IANA has assigned numbers for 2 hybrid PQ KEX widely used in tests

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

20 months agoSHA3_squeeze(): The next argument is int
Tomas Mraz [Mon, 20 Nov 2023 16:46:26 +0000 (17:46 +0100)] 
SHA3_squeeze(): The next argument is int

Amend the assembler so it uses only 32bit value.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22750)

20 months agokeccak1600-armv4.pl: Further fix for the DigestSqueeze() support
Tomas Mraz [Thu, 16 Nov 2023 16:52:39 +0000 (17:52 +0100)] 
keccak1600-armv4.pl: Further fix for the DigestSqueeze() support

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22750)

20 months agoCross Compiles CI: Run evp tests on pull requests
Tomas Mraz [Thu, 16 Nov 2023 12:02:20 +0000 (13:02 +0100)] 
Cross Compiles CI: Run evp tests on pull requests

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22750)

20 months agocontributing-doc: give example commit message with "CLA: trivial"
James Muir [Mon, 20 Nov 2023 18:14:12 +0000 (13:14 -0500)] 
contributing-doc: give example commit message with "CLA: trivial"

The text "CLA: trivial" should go at the bottom of the commit message.
Also, update the force-push command to include the repository and
branch, which can avoid unexpected force-push results.

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22775)

20 months agoAdapt C compiler detection for VSI C on x86_64
Richard Levitte [Tue, 21 Nov 2023 13:36:37 +0000 (14:36 +0100)] 
Adapt C compiler detection for VSI C on x86_64

VSI C on OpenVMS for x86_64 has a bit more information than on other
hardware.  This is no doubt because it's based on LLVM which leaves an
opening for cross compilation.

VSI C on Itanium:

    $ CC/VERSION
    VSI C V7.4-001 on OpenVMS IA64 V8.4-2L3

VSI C on x86_64:

    $ CC/VERSION
    VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22792)

20 months agospeed: make hmac(sha256) the default hmac
James Muir [Tue, 21 Nov 2023 05:09:38 +0000 (00:09 -0500)] 
speed: make hmac(sha256) the default hmac

prefer hmac(sha256) rather than hmac(md5).  Also, drop the "skip_hmac"
label.  If we are supposed to do hmac(hash_func) and hash_func cannot
be found, then error out immediately.

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

20 months agoFix a possible memory leak in SM2 provider
Huiyue Xu [Wed, 22 Nov 2023 01:55:27 +0000 (09:55 +0800)] 
Fix a possible memory leak in SM2 provider

ctx->propq that strdup from input parameter propq in sm2sig_newctx,
is not released. It should be released in sm2sig_freectx and copied
to dstctx in sm2sig_dupctx. And dstctx->id and dstctx->propq should
be set NULL to avoid releasing id/propq of srcctx when err occurs.

Signed-off-by: Huiyue Xu <xuhuiyue@huawei.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22796)

20 months agoUpdate fuzz corpora
Hugo Landau [Thu, 23 Nov 2023 14:50:03 +0000 (14:50 +0000)] 
Update fuzz corpora

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

20 months agoQUIC SRTM: Switch to using AES-128-ECB
Hugo Landau [Tue, 14 Nov 2023 11:03:46 +0000 (11:03 +0000)] 
QUIC SRTM: Switch to using AES-128-ECB

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

20 months agoQUIC SRTM: Harden SRTM in event of allocation failure
Hugo Landau [Fri, 3 Nov 2023 18:18:36 +0000 (18:18 +0000)] 
QUIC SRTM: Harden SRTM in event of allocation failure

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

20 months agoQUIC SRTM: Update fuzz corpora
Hugo Landau [Fri, 3 Nov 2023 15:38:27 +0000 (15:38 +0000)] 
QUIC SRTM: Update fuzz corpora

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

20 months agoQUIC SRTM: Amend glossary
Hugo Landau [Fri, 3 Nov 2023 14:14:14 +0000 (14:14 +0000)] 
QUIC SRTM: Amend glossary

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

20 months agoQUIC SRTM: Add test
Hugo Landau [Fri, 3 Nov 2023 12:23:14 +0000 (12:23 +0000)] 
QUIC SRTM: Add test

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

20 months agoFuzzing: Fix helper shebang on NixOS
Hugo Landau [Fri, 3 Nov 2023 11:56:40 +0000 (11:56 +0000)] 
Fuzzing: Fix helper shebang on NixOS

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

20 months agoQUIC SRTM: Add fuzzer for SRTM
Hugo Landau [Fri, 3 Nov 2023 11:56:29 +0000 (11:56 +0000)] 
QUIC SRTM: Add fuzzer for SRTM

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

20 months agoQUIC SRTM: Add SRTM
Hugo Landau [Fri, 3 Nov 2023 11:56:14 +0000 (11:56 +0000)] 
QUIC SRTM: Add SRTM

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

20 months agoMake CHANGES.md header more appropriate
Hugo Landau [Mon, 20 Nov 2023 15:07:09 +0000 (15:07 +0000)] 
Make CHANGES.md header more appropriate

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

(cherry picked from commit d330fef1f1446c968e31803778bc7b3d067c7e99)

20 months agoAmend NEWS.md to be more like release notes
Hugo Landau [Mon, 20 Nov 2023 14:06:42 +0000 (14:06 +0000)] 
Amend NEWS.md to be more like release notes

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

(cherry picked from commit 5e07ea4f82b5250d64183ddda2b56ebf37df126a)

20 months agodoc: fix description of mac "block-size" parameter
James Muir [Fri, 17 Nov 2023 22:58:24 +0000 (17:58 -0500)] 
doc: fix description of mac "block-size" parameter

The macro for "block-size" is OSSL_MAC_PARAM_BLOCK_SIZE, and this
parameter is not settable.  Refer to the "customization string" rather
than the "custom value" (in the Blake2 spec, this is called the
personalization string).

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

20 months agodoc: better description of KECCAK-KMAC XOF
James Muir [Mon, 13 Nov 2023 19:28:23 +0000 (14:28 -0500)] 
doc: better description of KECCAK-KMAC XOF

KECCAK-KMAC-128 and KECCAK-KMAC-256 are extendable output functions
that have been defined because they are convenient for implementing
KMAC.  Give definitions for them so that users aren't left to figure
that out themselves.  KECCAK-KMAC-128 is very similar to SHAKE-128,
and KECCAK-KMAC-256 is very similar to SHAKE-256.

Related to #22619.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22755)

20 months agoUpdate the provider documentation
Matt Caswell [Fri, 10 Nov 2023 15:33:21 +0000 (15:33 +0000)] 
Update the provider documentation

Make the documentation match reality. Add lots of missing algorithms.

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

20 months agoUpdate OpenSSL logos
James Muir [Sun, 5 Nov 2023 03:06:06 +0000 (23:06 -0400)] 
Update OpenSSL logos

Add two new files

  doc/images/openssl-square.svg
  doc/images/openssl-square-nontransparent.png

and update the existing file

  doc/images/openssl.svg

The "square" versions of the logo write "Open" and "SSL" on separate
lines, so that less horizontal space is used.

The png file (nontransparent, white background) can be used to update
the profile picture for the OpenSSL organization on GitHub.

For the existing logo, openssl.svg, the subtitle "Cryptography and
SSL/TLS Toolkit" has been dropped and the text-elements have been
converted to paths (so they are no longer dependent on what fonts the
renderer provides).

The svg files were provided by Anton A.

Part of https://github.com/openssl/project/issues/262

Reviewed-by: Anton Arapov <anton@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22626)

20 months agoFix possible memleak in PKCS7_add0_attrib_signing_time
Bernd Edlinger [Tue, 14 Nov 2023 01:42:42 +0000 (02:42 +0100)] 
Fix possible memleak in PKCS7_add0_attrib_signing_time

When PKCS7_add_signed_attribute fails, the ASN1_TIME
object may be leaked when it was not passed in as
input parameter.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22772)

20 months agoFix a possible use-after-free in custom_exts_free
Bernd Edlinger [Mon, 20 Nov 2023 09:05:49 +0000 (10:05 +0100)] 
Fix a possible use-after-free in custom_exts_free

This may happen when ssl_cert_dup calls custom_exts_copy, where
a possible memory allocation error causes custom_exts_free
to be called twice: once in the error handling of custom_exts_copy
and a second time in the error handling of ssl_cert_dup.

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

20 months agoFix a possible memleak in CMS_sign_receipt
Bernd Edlinger [Fri, 17 Nov 2023 06:12:42 +0000 (07:12 +0100)] 
Fix a possible memleak in CMS_sign_receipt

When an error happens after cms_encode_Receipt
the ASN1_OCTET_STRING object "os" may be leaked.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22758)

20 months agoFix a possible memleak in PKCS7_add_attrib_smimecap
Bernd Edlinger [Wed, 15 Nov 2023 19:32:59 +0000 (20:32 +0100)] 
Fix a possible memleak in PKCS7_add_attrib_smimecap

When PKCS7_add_signed_attribute fails, the ASN1_STRING
object may be leaked.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22744)

20 months agoFix a possible memory leak in dane_tlsa_add
Bernd Edlinger [Wed, 15 Nov 2023 18:46:17 +0000 (19:46 +0100)] 
Fix a possible memory leak in dane_tlsa_add

Several error cases leak either the X509 object
or the pkey or the danetls_record object.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22743)

20 months agoFix typo in variable name
Anders Jansson [Sat, 18 Nov 2023 22:40:33 +0000 (23:40 +0100)] 
Fix typo in variable name

Fix spelling $cppfags2 => $cppflags2 in file Configurations/windows-makefile.tmpl

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22771)

20 months agoMove freeing of an old record layer to dtls1_clear_sent_buffer
Matt Caswell [Thu, 9 Nov 2023 14:45:33 +0000 (14:45 +0000)] 
Move freeing of an old record layer to dtls1_clear_sent_buffer

When we are clearing the sent messages queue we should ensure we free any
old write record layers that are no longer in use. Previously this logic
was in dtls1_hm_fragment_free() - but this can end up freeing the current
record layer under certain error conditions.

Fixes #22664

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22679)

20 months agozero data in hm_fragment on alloc
Neil Horman [Thu, 9 Nov 2023 13:13:58 +0000 (08:13 -0500)] 
zero data in hm_fragment on alloc

if we allocate a new hm_frament in dtls1_buffer_message with
dtls1_hm_fragment_new, the returned fragment contains uninitalized data in the
msg_header field.  If an error then occurs, and we free the fragment,
dtls_hm_fragment_free interrogates the msg_header field (which is garbage), and
potentially references undefined values, or worse, accidentally references
available memory that is not owned, leading to various corruptions.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22679)

20 months agoaugment quic demos to support ipv4/6 connections
Neil Horman [Tue, 31 Oct 2023 15:54:03 +0000 (11:54 -0400)] 
augment quic demos to support ipv4/6 connections

Because the quicserver utility supports expressly listening in ipv4/6
mode, its possible/likely that the server will listen on an ipv4
address, while the clients will connect via ipv6, leading to connection
failures.

Augment quic demo clients to afford them the same -6 option that the
server has so that connection family can be co-ordinated

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22577)

20 months agoNOTES-WINDOWS: fix named anchor links in table of contents
Matthias St. Pierre [Tue, 14 Nov 2023 10:34:43 +0000 (11:34 +0100)] 
NOTES-WINDOWS: fix named anchor links in table of contents

Those links were probably broken by some changes to the sanitizer
of the [github/markup] module.

[github/markup]: https://github.com/github/markup/#github-markup

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22725)

20 months agoBump actions/github-script from 6 to 7
dependabot[bot] [Wed, 15 Nov 2023 10:14:21 +0000 (10:14 +0000)] 
Bump actions/github-script from 6 to 7

Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
CLA: trivial

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

20 months agoConfigure: do not check for an absolute prefix in cross-builds
Viktor Szakats [Fri, 27 Aug 2021 12:22:15 +0000 (12:22 +0000)] 
Configure: do not check for an absolute prefix in cross-builds

The check is always made according to the host platform's rules, which may
not be true for true when the target platform is different, e.g. when
cross-building for Windows on a Linux machine. So skip this check when
used together with the `--cross-compile-prefix=` option.

Fixes https://github.com/openssl/openssl/issues/9520

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

20 months agoUpdate ci and ABI xml files to validate function parameters
Neil Horman [Mon, 13 Nov 2023 09:19:18 +0000 (04:19 -0500)] 
Update ci and ABI xml files to validate function parameters

libabigail is currenly only validating symbol presence and version
information in ci.  We should also be validating function parameters,
types, etc.  To do this we need to build the library with -g so the
dwarf information is available for libabigail to interrogate

while we're at it, also add a script to re-generate the xml that abidiff
uses for comparison during ci runs, to make updates easier

Fixes #22712

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

20 months agoCorrect tag len check when determining how much space we have in the pkt
Matt Caswell [Mon, 13 Nov 2023 11:27:54 +0000 (11:27 +0000)] 
Correct tag len check when determining how much space we have in the pkt

If the available space is equal to the tag length then we have no available
space for plaintext data.

Fixes #22699

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

20 months agoAdd some additional tests for the new fc "consumed" params
Matt Caswell [Mon, 13 Nov 2023 14:39:53 +0000 (14:39 +0000)] 
Add some additional tests for the new fc "consumed" params

Check that the "consumed" parameter is working as expected.

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

20 months agoKeep track of connection credit as we add stream data
Matt Caswell [Mon, 13 Nov 2023 14:16:57 +0000 (14:16 +0000)] 
Keep track of connection credit as we add stream data

If a single packet contains data from multiple streams we need to keep track
of the cummulative connection level credit consumed across all of the
streams. Once the connection level credit has been consumed we must stop
adding stream data.

Fixes #22706

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

20 months agoFix SHA3_squeeze on armv4.
slontis [Tue, 14 Nov 2023 01:40:09 +0000 (11:40 +1000)] 
Fix SHA3_squeeze on armv4.

For armv4 - Only the first 4 parameters can be passed via registers
(r0..r3).

As all of the general registers are already used,
r11 was used to store the 'next' param.
R11 is now pushed/poped on entry/exit.

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

20 months agodemos: tidy up makefiles, fix warnings
James Muir [Fri, 10 Nov 2023 19:02:00 +0000 (14:02 -0500)] 
demos: tidy up makefiles, fix warnings

Update makefiles so that consistent patterns are used.  Object files
are compiled from source using an implicit rule (but using our
CFLAGS); for linking, we give an explicit rule.  Ensure that "make
test" works in each subdirectory (even if it does not actually run any
applications).  The top-level demo makefile now works.

The makefiles are not make-agnostic.  e.g. they use the variable $(RM)
in "clean" recipes, which is defined in gnu-make but may not be
defined in others.

Part of #17806

Testing:

  $ cd demo
  $ make test

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

20 months agoImport repro from #22708 as a test case
наб [Mon, 13 Nov 2023 01:19:51 +0000 (02:19 +0100)] 
Import repro from #22708 as a test case

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

20 months agoFix BLAKE2s reporting the same EVP_MD_get_size() as BLAKE2b (64)
наб [Sun, 12 Nov 2023 23:44:06 +0000 (00:44 +0100)] 
Fix BLAKE2s reporting the same EVP_MD_get_size() as BLAKE2b (64)

Fixes: commit 6d1e730a1ea2c64bdffa88c6b3bee4c3f5bed602 ("Implement
 BLAKE2s with the same macro as BLAKE2b")
Closes: #22708
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22710)

20 months agoREADME: add link to OpenSSL 3.2 manual pages
Matthias St. Pierre [Sat, 4 Nov 2023 23:18:08 +0000 (00:18 +0100)] 
README: add link to OpenSSL 3.2 manual pages

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/22625)

20 months agoppc64: Fix SHA3_squeeze
Rohan McLure [Tue, 14 Nov 2023 03:14:33 +0000 (14:14 +1100)] 
ppc64: Fix SHA3_squeeze

Fix the conditional on the 'next' parameter passed into SHA3_squeeze.

Reported-by: David Benjamin <davidben@davidben.net>
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22722)

20 months agoDocument the exporter change in CHANGES.md and NEWS.md
Richard Levitte [Mon, 6 Nov 2023 10:09:38 +0000 (11:09 +0100)] 
Document the exporter change in CHANGES.md and NEWS.md

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

20 months agoAdd exporters for CMake
Richard Levitte [Wed, 3 May 2023 10:36:09 +0000 (12:36 +0200)] 
Add exporters for CMake

CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.

By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.

The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:

    OPENSSL_MODULES_DIR     Indicates the default installation directory
                            for OpenSSL loadable modules, such as providers.
    OPENSSL_RUNTIME_DIR     Indicates the default runtime directory, where
                            for example the openssl program is located.
    OPENSSL_PROGRAM         Is the full directory-and-filename of the
                            openssl program.

The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.

For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:

-   The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
    to the 'find_package(OpenSSL)' call.
-   The 'find_package' call itself must use the "Full Signature".  If you
    don't know any better, simply add the 'CONFIG' option, i.e. from this
    example:

        find_package(OpenSSL 3.0 REQUIRED)

    to this:

        find_package(OpenSSL 3.0 REQUIRED CONFIG)

Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:

- Those in 'exporters/' are installed in the location that 'pkg-config'
  itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
  directly against an OpenSSL build tree.

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

20 months agoClean up exporters, specifically those we have for pkg-config
Richard Levitte [Wed, 3 May 2023 10:29:00 +0000 (12:29 +0200)] 
Clean up exporters, specifically those we have for pkg-config

The pkg-config exporters were a special hack, all in
Configurations/unix-Makefile.tmpl, and this was well and good as long
as that was the only main package interface configuration system that we
cared about.

Things have changed, though, so we move the pkg-config production to be
templatable in a more flexible manner.  Additional templates for other
interface configuration systems can then be added fairly easily.

Two variants of the .pc files are produced:

- Those in 'exporters/' are installed in the location that 'pkg-config'
  itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
  directly against an OpenSSL build tree.

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

20 months agoExclude more in the fuzz introspector report
Kurt Roeckx [Sun, 12 Nov 2023 09:26:33 +0000 (10:26 +0100)] 
Exclude more in the fuzz introspector report

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22707)

20 months agoRearrange some CI jobs
Tomas Mraz [Fri, 10 Nov 2023 16:28:16 +0000 (17:28 +0100)] 
Rearrange some CI jobs

Those less useful should be in daily or on-push runs.

Those more likely triggering CI failure that do not
take too much time should be in main on pull request CI.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22693)

20 months agoCorrect 50-nonstop.conf to support QUIC tests under SPT threading models.
Randall S. Becker [Fri, 10 Nov 2023 20:24:22 +0000 (20:24 +0000)] 
Correct 50-nonstop.conf to support QUIC tests under SPT threading models.

This fix also separates the FLOSS from SPT configurations which should not
have been conflated in the 3.0 series.

Related-to: #22588
Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
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/22697)

(cherry picked from commit e3c38759608bb48d70ddfdaa1c88bcd86069952d)

20 months agoEnable AES and SHA3 optimisations on Apple Silicon M3-based macOS systems
Tom Cosgrove [Wed, 8 Nov 2023 22:45:55 +0000 (22:45 +0000)] 
Enable AES and SHA3 optimisations on Apple Silicon M3-based macOS systems

AES gets a performance enhancement of 19-36%, similar to the M1 and M2.

SHA3 gets an improvement of 4-7% on buffers 256 bytes or larger.

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

Change-Id: I2bf40bbde824823bb8cf2efd1bd945da9f23a703

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

20 months agoForce Nonstop to use fcntl(F_GETFL) in BIO_sock_nbio
Neil Horman [Fri, 10 Nov 2023 20:31:23 +0000 (15:31 -0500)] 
Force Nonstop to use fcntl(F_GETFL) in BIO_sock_nbio

In tracking down a hang, we found that nonstop platforms were falling
into the if #ifdef FIONBIO clause in the implementation of
BIO_sock_nbio.  While the platform defines this macro, sockets set with
this continued to operate in blocking mode.  Given that the platform
also support O_NONBLOCK, adjust the ifdef to have the nonstop platform
use that method to ensure that sockets enter blocking mode

Related-To #22588

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

20 months agoset_client_ciphersuite(): Fix for potential UB if session->cipher is NULL
Alexey Fofanov [Wed, 18 Oct 2023 11:23:22 +0000 (14:23 +0300)] 
set_client_ciphersuite(): Fix for potential UB if session->cipher is NULL

This currently cannot happen without an application overriding
the session with some bogus data so this is an ossl_assert()
check.

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

20 months agoAugment rand argument parsing to allow scaling
Neil Horman [Sun, 5 Nov 2023 22:51:38 +0000 (17:51 -0500)] 
Augment rand argument parsing to allow scaling

Instead of just accepting a number of bytes, allows openssl rand to
accept a k|m|g suffix to scale to kbytes/mbytes/gbytes

Fixes #22622

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22624)

20 months agoProperly limit the variable output size for BLAKE2
Tomas Mraz [Wed, 8 Nov 2023 09:14:08 +0000 (10:14 +0100)] 
Properly limit the variable output size for BLAKE2

The upper limit of the output size is the default output size of
the respective algorithm variants.

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

20 months agoFix CI breakage due to ABIDIFF failure
Tomas Mraz [Fri, 10 Nov 2023 15:00:18 +0000 (16:00 +0100)] 
Fix CI breakage due to ABIDIFF failure

Also sync libcrypto.num and libssl.num with 3.2 branch and
fix the EVP_DigestSqueeze symbol version.

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

21 months agoSupport EVP_DigestSqueeze() for in the digest provider for s390x.
Holger Dengler [Wed, 27 Sep 2023 13:40:47 +0000 (15:40 +0200)] 
Support EVP_DigestSqueeze() for in the digest provider for s390x.

The new EVP_DigestSqueeze() API requires changes to all keccak-based
digest provider implementations. Update the s390x-part of the SHA3
digest provider.

Squeeze for SHA3 is not supported, so add an empty function pointer
(NULL).

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoFix state handling of keccak_final for s390x.
Holger Dengler [Wed, 27 Sep 2023 13:43:18 +0000 (15:43 +0200)] 
Fix state handling of keccak_final for s390x.

The digest life-cycle state diagram has been updated for XOF. Fix the
state handling in s390x_keccac_final() according to the updated state
diagram.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoFix state handling of shake_final for s390x.
Holger Dengler [Wed, 27 Sep 2023 13:37:29 +0000 (15:37 +0200)] 
Fix state handling of shake_final for s390x.

The digest life-cycle state diagram has been updated for XOF. Fix the
state handling in s390x_shake_final() according to the updated state
diagram.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoFix state handling of sha3_final for s390x.
Holger Dengler [Wed, 27 Sep 2023 13:36:59 +0000 (15:36 +0200)] 
Fix state handling of sha3_final for s390x.

The digest life-cycle state diagram has been updated for XOF. Fix the
state handling in s390x_sha3_final() according to the updated state
diagram.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoFix state handling of sha3_absorb for s390x.
Holger Dengler [Wed, 27 Sep 2023 13:36:23 +0000 (15:36 +0200)] 
Fix state handling of sha3_absorb for s390x.

The digest life-cycle state diagram has been updated for XOF. Fix the
state handling in s390x_sha3_aborb() according to the updated state
diagram.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoAdd xof state handing for generic sha3 absorb.
Holger Dengler [Wed, 27 Sep 2023 19:54:34 +0000 (21:54 +0200)] 
Add xof state handing for generic sha3 absorb.

The digest life-cycle diagram specifies state transitions to `updated`
(aka XOF_STATE_ABSORB) only from `initialised` and `updated`. Add this
checking to the generic sha3 absorb implementation.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoSupport multiple calls of low level SHA3_squeeze() for s390x.
Holger Dengler [Wed, 27 Sep 2023 09:18:18 +0000 (11:18 +0200)] 
Support multiple calls of low level SHA3_squeeze() for s390x.

The low level SHA3_Squeeze() function needed to change slightly so
that it can handle multiple squeezes. Support this on s390x
architecture as well.

Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22221)

21 months agoAdd EVP_DigestSqueeze() API.
slontis [Fri, 21 Jul 2023 05:05:38 +0000 (15:05 +1000)] 
Add EVP_DigestSqueeze() API.

Fixes #7894

This allows SHAKE to squeeze multiple times with different output sizes.

The existing EVP_DigestFinalXOF() API has been left as a one shot
operation. A similar interface is used by another toolkit.

The low level SHA3_Squeeze() function needed to change slightly so
that it can handle multiple squeezes. This involves changing the
assembler code so that it passes a boolean to indicate whether
the Keccak function should be called on entry.
At the provider level, the squeeze is buffered, so that it only requests
a multiple of the blocksize when SHA3_Squeeze() is called. On the first
call the value is zero, on subsequent calls the value passed is 1.

This PR is derived from the excellent work done by @nmathewson in
https://github.com/openssl/openssl/pull/7921

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

21 months agocms demos: print signingTime attributes
James Muir [Fri, 3 Nov 2023 17:15:04 +0000 (13:15 -0400)] 
cms demos: print signingTime attributes

Add a makefile for the cms demos, and add a routine to cms_ver.c to
print any signingTime attributes from the CMS_ContentInfo object.
This provides an example that could be extended if an application
wants to examine the purported signing times.

Part of #8026

Testing:

  $ cd demos/cms
  $ make test

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

21 months agoapps/list.c: Check the result of inserting a provider into provider's stack
Alexey Fofanov [Wed, 18 Oct 2023 11:23:22 +0000 (14:23 +0300)] 
apps/list.c: Check the result of inserting a provider into provider's stack

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

(cherry picked from commit 15b83e04a5e125ab873ace1e474790a4a5b44647)

21 months agoFix a possible memory leak of ssl->s3.tmp.psk
Bernd Edlinger [Mon, 6 Nov 2023 09:44:27 +0000 (10:44 +0100)] 
Fix a possible memory leak of ssl->s3.tmp.psk

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22637)

21 months agoAfter a stream has implicit length don't add more stream related frames
Matt Caswell [Wed, 8 Nov 2023 10:15:25 +0000 (10:15 +0000)] 
After a stream has implicit length don't add more stream related frames

Once we have decided that a stream has an implicit length then we should
treat the packet as full and not try to add any more stream related frames
to the packet.

Fixes #22658

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

21 months agoAdd config tests for including provider config files
Veronika Hanulíková [Thu, 12 Oct 2023 12:38:06 +0000 (14:38 +0200)] 
Add config tests for including provider config files

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