Skip to content

Commit

Permalink
deps: upgrade openssl sources to quictls/openssl-3.0.9-quic1
Browse files Browse the repository at this point in the history
PR-URL: nodejs#48402
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
  • Loading branch information
nodejs-github-bot authored and Ceres6 committed Aug 14, 2023
1 parent b45bcd9 commit 0782ff0
Show file tree
Hide file tree
Showing 281 changed files with 4,949 additions and 3,717 deletions.
84 changes: 80 additions & 4 deletions deps/openssl/openssl/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,82 @@ breaking changes, and mappings for the large list of deprecated functions.

[Migration guide]: https://github.com/openssl/openssl/tree/master/doc/man7/migration_guide.pod

### Changes between 3.0.8 and 3.0.8+quic [7 Feb 2023]
### Changes between 3.0.9 and 3.0.9+quic [30 May 2023]
* Add QUIC API support from BoringSSL
*Todd Short*
### Changes between 3.0.8 and 3.0.9 [30 May 2023]

* Add QUIC API support from BoringSSL.
* Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.

*Todd Short*
OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical
numeric text form. For gigantic sub-identifiers, this would take a very
long time, the time complexity being O(n^2) where n is the size of that
sub-identifier. ([CVE-2023-2650])

To mitigitate this, `OBJ_obj2txt()` will only translate an OBJECT
IDENTIFIER to canonical numeric text form if the size of that OBJECT
IDENTIFIER is 586 bytes or less, and fail otherwise.

The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT
IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at
most 128 sub-identifiers, and that the maximum value that each sub-
identifier may have is 2^32-1 (4294967295 decimal).

For each byte of every sub-identifier, only the 7 lower bits are part of
the value, so the maximum amount of bytes that an OBJECT IDENTIFIER with
these restrictions may occupy is 32 * 128 / 7, which is approximately 586
bytes.

Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5

*Richard Levitte*

* Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
happens if the buffer size is 4 mod 5 in 16 byte AES blocks. This can
trigger a crash of an application using AES-XTS decryption if the memory
just after the buffer being decrypted is not mapped.
Thanks to Anton Romanov (Amazon) for discovering the issue.
([CVE-2023-1255])

*Nevine Ebeid*

* Reworked the Fix for the Timing Oracle in RSA Decryption ([CVE-2022-4304]).
The previous fix for this timing side channel turned out to cause
a severe 2-3x performance regression in the typical use case
compared to 3.0.7. The new fix uses existing constant time
code paths, and restores the previous performance level while
fully eliminating all existing timing side channels.
The fix was developed by Bernd Edlinger with testing support
by Hubert Kario.

*Bernd Edlinger*

* Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention
that it does not enable policy checking. Thanks to David Benjamin for
discovering this issue.
([CVE-2023-0466])

*Tomáš Mráz*

* Fixed an issue where invalid certificate policies in leaf certificates are
silently ignored by OpenSSL and other certificate policy checks are skipped
for that certificate. A malicious CA could use this to deliberately assert
invalid certificate policies in order to circumvent policy checking on the
certificate altogether.
([CVE-2023-0465])

*Matt Caswell*

* Limited the number of nodes created in a policy tree to mitigate
against CVE-2023-0464. The default limit is set to 1000 nodes, which
should be sufficient for most installations. If required, the limit
can be adjusted by setting the OPENSSL_POLICY_TREE_NODES_MAX build
time define to a desired maximum number of nodes or zero to allow
unlimited growth.
([CVE-2023-0464])

*Paul Dale*

### Changes between 3.0.7 and 3.0.8 [7 Feb 2023]

Expand Down Expand Up @@ -19584,6 +19655,11 @@ ndif

<!-- Links -->

[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465
[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464
[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401
[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286
[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217
Expand All @@ -19594,7 +19670,7 @@ ndif
[CVE-2022-4203]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4203
[CVE-2022-3996]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-3996
[CVE-2022-2274]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274
[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274
[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2097
[CVE-2020-1971]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1971
[CVE-2020-1967]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1967
[CVE-2019-1563]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1563
Expand Down
6 changes: 5 additions & 1 deletion deps/openssl/openssl/Configurations/10-main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1934,5 +1934,9 @@ my %targets = (
cflags => add("/POINTER_SIZE=64=ARGV"),
pointer_size => "64",
},

"vms-x86_64" => {
inherit_from => [ "vms-generic" ],
bn_ops => "SIXTY_FOUR_BIT",
pointer_size => "",
}
);
12 changes: 3 additions & 9 deletions deps/openssl/openssl/Configurations/50-vms-x86_64.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
## -*- mode: perl; -*-

# OpenVMS for x86_64 is currently out on a field test. A native C compiler
# is currently not available, but there are cross-compilation tools for
# OpenVMS for Itanium. This configuration file holds the necessary target(s)
# to make that useful.
#
# The assumption is that *building* is done on Itanium, and then the source
# tree and build tree are transferred to x86_64, where tests can be performed,
# and installation can be done.
# OpenVMS cross compilation of x86_64 binaries on Itanium. This doesn't
# fit the usual cross compilation parameters that are used on Unixly machines

(
'vms-x86_64' => {
'vms-x86_64-cross-ia64' => {
inherit_from => [ 'vms-generic' ],
CC => 'XCC',
bn_ops => 'SIXTY_FOUR_BIT',
Expand Down
94 changes: 0 additions & 94 deletions deps/openssl/openssl/Configurations/90-team.norelease.conf

This file was deleted.

10 changes: 3 additions & 7 deletions deps/openssl/openssl/Configurations/descrip.mms.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
my @lib_cflags_no_inst = ( $target{no_inst_lib_cflags} // @lib_cflags );
my @lib_cflags_cont = ( $target{shared_cflag} || (),
@{$config{lib_cflags}}, @{$config{shared_cflag}},
$cnf_cflags, '$(CFLAGS)');
@cnf_cflags, '$(CFLAGS)');
our $lib_cflags = join('', @lib_cflags, @lib_cflags_cont );
our $lib_cflags_no_inst = join('', @lib_cflags_no_inst, @lib_cflags_cont );
our $lib_ldflags =
Expand Down Expand Up @@ -161,7 +161,7 @@
my @dso_cflags_no_inst = ( $target{no_inst_dso_cflags} // @dso_cflags );
my @dso_cflags_cont = ( $target{module_cflag} || (),
@{$config{dso_cflags}}, @{$config{module_cflag}},
$cnf_cflags, '$(CFLAGS)');
@cnf_cflags, '$(CFLAGS)');
our $dso_cflags = join('', @dso_cflags, @dso_cflags_cont );
our $dso_cflags_no_inst = join('', @dso_cflags_no_inst, @dso_cflags_cont );
our $dso_ldflags =
Expand Down Expand Up @@ -196,13 +196,9 @@
my @bin_cflags = ( $target{bin_cflags} // () );
my @bin_cflags_no_inst = ( $target{no_inst_bin_cflags} // @bin_cflags );
my @bin_cflags_cont = ( @{$config{bin_cflags}},
$cnf_cflags, '$(CFLAGS)');
@cnf_cflags, '$(CFLAGS)');
our $bin_cflags = join('', @bin_cflags, @bin_cflags_cont );
our $bin_cflags_no_inst = join('', @bin_cflags_no_inst, @bin_cflags_cont );
our $bin_cflags =
join('', $target{bin_cflags} || (),
@{$config{bin_cflags}},
@cnf_cflags, '$(CFLAGS)');
our $bin_ldflags =
join('', $target{bin_lflags} || (),
@{$config{bin_lflags}},
Expand Down
3 changes: 2 additions & 1 deletion deps/openssl/openssl/Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,8 @@ providers/fips.module.sources.new: configdata.pm
crypto/ec/asm/*.pl \
crypto/modes/asm/*.pl \
crypto/sha/asm/*.pl \
crypto/x86_64cpuid.pl; do \
crypto/*cpuid.pl crypto/*cpuid.S \
crypto/*cap.c; do \
echo "$$x"; \
done \
) | sort | uniq > providers/fips.module.sources.new
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl/Configurations/windows-makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ EOF
my $generator;
if ($gen0 =~ /\.pl$/) {
$generator = '"$(PERL)"'.$gen_incs.' "'.$gen0.'"'.$gen_args
.' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)';
.' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
} elsif ($gen0 =~ /\.S$/) {
$generator = undef;
} else {
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl/Configure
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m)
}

if ($target =~ /linux.*-mips/ && !$disabled{asm}
&& !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
&& !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
# minimally required architecture flags for assembly modules
my $value;
$value = '-mips2' if ($target =~ /mips32/);
Expand Down
19 changes: 18 additions & 1 deletion deps/openssl/openssl/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ OpenSSL Releases
OpenSSL 3.0
-----------

### Major changes between OpenSSL 3.0.8 and OpenSSL 3.0.9 [30 May 2023]

* Mitigate for very slow `OBJ_obj2txt()` performance with gigantic OBJECT
IDENTIFIER sub-identities. ([CVE-2023-2650])
* Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms
([CVE-2023-1255])
* Fixed documentation of X509_VERIFY_PARAM_add0_policy() ([CVE-2023-0466])
* Fixed handling of invalid certificate policies in leaf certificates
([CVE-2023-0465])
* Limited the number of nodes created in a policy tree ([CVE-2023-0464])

### Major changes between OpenSSL 3.0.7 and OpenSSL 3.0.8 [7 Feb 2023]

* Fixed NULL dereference during PKCS7 data verification ([CVE-2023-0401])
Expand Down Expand Up @@ -1430,6 +1441,12 @@ OpenSSL 0.9.x
* Support for various new platforms

<!-- Links -->

[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465
[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464
[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401
[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286
[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217
Expand All @@ -1440,7 +1457,7 @@ OpenSSL 0.9.x
[CVE-2022-4203]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4203
[CVE-2022-3996]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-3996
[CVE-2022-2274]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274
[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274
[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2097
[CVE-2020-1971]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1971
[CVE-2020-1967]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1967
[CVE-2019-1563]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1563
Expand Down
14 changes: 14 additions & 0 deletions deps/openssl/openssl/NOTES-NONSTOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ instead of `nsx` in the set above.
You cannot build for TNS/E for FIPS, so you must specify the `no-fips`
option to `./Configure`.

Linking and Loading Considerations
----------------------------------

Because of how the NonStop Common Runtime Environment (CRE) works, there are
restrictions on how programs can link and load with OpenSSL libraries.
On current NonStop platforms, programs cannot both statically link OpenSSL
libraries and dynamically load OpenSSL shared libraries concurrently. If this
is done, there is a high probability of encountering a SIGSEGV condition
relating to `atexit()` processing when a shared library is unloaded and when
the program terminates. This limitation applies to all OpenSSL shared library
components.

A resolution to this situation is under investigation.

About Prefix and OpenSSLDir
---------------------------

Expand Down
17 changes: 17 additions & 0 deletions deps/openssl/openssl/NOTES-VMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,23 @@ When done, we recommend that you turn that flag back off:

$ set image /flag=nocall_debug [.test]evp_test.exe

About assembler acceleration
----------------------------

OpenSSL has assembler acceleration for a number of BIGNUM and crypto
routines. The VMS config targets tries to look for a selection of
assemblers and will use what they find. If none of the assemblers are
found, OpenSSL will be built as if `no-asm` was configured.

### For Itanium / IA64 / I64

- There is only one assembler, a port of Intel's `ias`, found in the
HP Open Source Tools CD, available through [DECUSlib](http://www.decuslib.com).
It's assumed to be set up as per the instructions, where `disk` and
`dir` are expected to be adapted to local conditions:

$ ias :== $disk:[dir]iasi64.exe

Checking the distribution
-------------------------

Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ What This Is
This is a fork of [OpenSSL](https://www.openssl.org) to enable QUIC. In addition
to the website, the official source distribution is at
<https://github.com/openssl/openssl>. The OpenSSL `README` can be found at
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.8%2Bquic/README-OpenSSL.md)
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.9%2Bquic/README-OpenSSL.md)

This fork adds APIs that can be used by QUIC implementations for connection
handshakes. Quoting the IETF Working group
Expand Down
4 changes: 2 additions & 2 deletions deps/openssl/openssl/VERSION.dat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MAJOR=3
MINOR=0
PATCH=8
PATCH=9
PRE_RELEASE_TAG=
BUILD_METADATA=quic
RELEASE_DATE="7 Feb 2023"
RELEASE_DATE="30 May 2023"
SHLIB_VERSION=81.3
Loading

0 comments on commit 0782ff0

Please sign in to comment.