Skip to content

Commit d167837

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: upgrade openssl sources to quictls/openssl-3.0.10+quic1
Reviewed-By: Rafael Gonzaga <[email protected]> PR-URL: nodejs#49036
1 parent 7e97e90 commit d167837

File tree

173 files changed

+2430
-1223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+2430
-1223
lines changed

deps/openssl/openssl/CHANGES.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,70 @@ breaking changes, and mappings for the large list of deprecated functions.
2828

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

31-
### Changes between 3.0.9 and 3.0.9+quic [30 May 2023]
32-
* Add QUIC API support from BoringSSL
31+
### Changes between 3.0.10 and 3.0.10+quic [1 Aug 2023]
32+
33+
* Add QUIC API support from BoringSSL
34+
3335
*Todd Short*
36+
37+
### Changes between 3.0.9 and 3.0.10 [1 Aug 2023]
38+
39+
* Fix excessive time spent checking DH q parameter value.
40+
41+
The function DH_check() performs various checks on DH parameters. After
42+
fixing CVE-2023-3446 it was discovered that a large q parameter value can
43+
also trigger an overly long computation during some of these checks.
44+
A correct q value, if present, cannot be larger than the modulus p
45+
parameter, thus it is unnecessary to perform these checks if q is larger
46+
than p.
47+
48+
If DH_check() is called with such q parameter value,
49+
DH_CHECK_INVALID_Q_VALUE return flag is set and the computationally
50+
intensive checks are skipped.
51+
52+
([CVE-2023-3817])
53+
54+
*Tomáš Mráz*
55+
56+
* Fix DH_check() excessive time with over sized modulus.
57+
58+
The function DH_check() performs various checks on DH parameters. One of
59+
those checks confirms that the modulus ("p" parameter) is not too large.
60+
Trying to use a very large modulus is slow and OpenSSL will not normally use
61+
a modulus which is over 10,000 bits in length.
62+
63+
However the DH_check() function checks numerous aspects of the key or
64+
parameters that have been supplied. Some of those checks use the supplied
65+
modulus value even if it has already been found to be too large.
66+
67+
A new limit has been added to DH_check of 32,768 bits. Supplying a
68+
key/parameters with a modulus over this size will simply cause DH_check() to
69+
fail.
70+
71+
([CVE-2023-3446])
72+
73+
*Matt Caswell*
74+
75+
* Do not ignore empty associated data entries with AES-SIV.
76+
77+
The AES-SIV algorithm allows for authentication of multiple associated
78+
data entries along with the encryption. To authenticate empty data the
79+
application has to call `EVP_EncryptUpdate()` (or `EVP_CipherUpdate()`)
80+
with NULL pointer as the output buffer and 0 as the input buffer length.
81+
The AES-SIV implementation in OpenSSL just returns success for such call
82+
instead of performing the associated data authentication operation.
83+
The empty data thus will not be authenticated. ([CVE-2023-2975])
84+
85+
Thanks to Juerg Wullschleger (Google) for discovering the issue.
86+
87+
The fix changes the authentication tag value and the ciphertext for
88+
applications that use empty associated data entries with AES-SIV.
89+
To decrypt data encrypted with previous versions of OpenSSL the application
90+
has to skip calls to `EVP_DecryptUpdate()` for empty associated data
91+
entries.
92+
93+
*Tomáš Mráz*
94+
3495
### Changes between 3.0.8 and 3.0.9 [30 May 2023]
3596

3697
* Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
@@ -45,7 +106,7 @@ breaking changes, and mappings for the large list of deprecated functions.
45106
IDENTIFIER to canonical numeric text form if the size of that OBJECT
46107
IDENTIFIER is 586 bytes or less, and fail otherwise.
47108

48-
The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT
109+
The basis for this restriction is [RFC 2578 (STD 58), section 3.5]. OBJECT
49110
IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at
50111
most 128 sub-identifiers, and that the maximum value that each sub-
51112
identifier may have is 2^32-1 (4294967295 decimal).
@@ -55,8 +116,6 @@ breaking changes, and mappings for the large list of deprecated functions.
55116
these restrictions may occupy is 32 * 128 / 7, which is approximately 586
56117
bytes.
57118

58-
Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
59-
60119
*Richard Levitte*
61120

62121
* Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
@@ -19655,6 +19714,10 @@ ndif
1965519714

1965619715
<!-- Links -->
1965719716

19717+
[CVE-2023-3817]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3817
19718+
[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446
19719+
[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975
19720+
[RFC 2578 (STD 58), section 3.5]: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
1965819721
[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
1965919722
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
1966019723
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466

deps/openssl/openssl/Configure

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,7 @@ my @disable_cascades = (
599599

600600
"crypto-mdebug" => [ "crypto-mdebug-backtrace" ],
601601

602-
# If no modules, then no dynamic engines either
603-
"module" => [ "dynamic-engine" ],
602+
"module" => [ "dynamic-engine", "fips" ],
604603

605604
# Without shared libraries, dynamic engines aren't possible.
606605
# This is due to them having to link with libcrypto and register features
@@ -618,8 +617,6 @@ my @disable_cascades = (
618617
# or modules.
619618
"pic" => [ "shared", "module" ],
620619

621-
"module" => [ "fips", "dso" ],
622-
623620
"engine" => [ "dynamic-engine", grep(/eng$/, @disablables) ],
624621
"dynamic-engine" => [ "loadereng" ],
625622
"hw" => [ "padlockeng" ],

deps/openssl/openssl/INSTALL.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,14 +796,22 @@ By default OpenSSL will attempt to stay in memory until the process exits.
796796
This is so that libcrypto and libssl can be properly cleaned up automatically
797797
via an `atexit()` handler. The handler is registered by libcrypto and cleans
798798
up both libraries. On some platforms the `atexit()` handler will run on unload of
799-
libcrypto (if it has been dynamically loaded) rather than at process exit. This
800-
option can be used to stop OpenSSL from attempting to stay in memory until the
799+
libcrypto (if it has been dynamically loaded) rather than at process exit.
800+
801+
This option can be used to stop OpenSSL from attempting to stay in memory until the
801802
process exits. This could lead to crashes if either libcrypto or libssl have
802803
already been unloaded at the point that the atexit handler is invoked, e.g. on a
803804
platform which calls `atexit()` on unload of the library, and libssl is unloaded
804-
before libcrypto then a crash is likely to happen. Applications can suppress
805-
running of the `atexit()` handler at run time by using the
806-
`OPENSSL_INIT_NO_ATEXIT` option to `OPENSSL_init_crypto()`.
805+
before libcrypto then a crash is likely to happen.
806+
807+
Note that shared library pinning is not automatically disabled for static builds,
808+
i.e., `no-shared` does not imply `no-pinshared`. This may come as a surprise when
809+
linking libcrypto statically into a shared third-party library, because in this
810+
case the shared library will be pinned. To prevent this behaviour, you need to
811+
configure the static build using `no-shared` and `no-pinshared` together.
812+
813+
Applications can suppress running of the `atexit()` handler at run time by
814+
using the `OPENSSL_INIT_NO_ATEXIT` option to `OPENSSL_init_crypto()`.
807815
See the man page for it for further details.
808816

809817
### no-posix-io

deps/openssl/openssl/NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ OpenSSL Releases
1818
OpenSSL 3.0
1919
-----------
2020

21+
### Major changes between OpenSSL 3.0.9 and OpenSSL 3.0.10 [1 Aug 2023]
22+
23+
* Fix excessive time spent checking DH q parameter value ([CVE-2023-3817])
24+
* Fix DH_check() excessive time with over sized modulus ([CVE-2023-3446])
25+
* Do not ignore empty associated data entries with AES-SIV ([CVE-2023-2975])
26+
2127
### Major changes between OpenSSL 3.0.8 and OpenSSL 3.0.9 [30 May 2023]
2228

2329
* Mitigate for very slow `OBJ_obj2txt()` performance with gigantic OBJECT
@@ -1442,6 +1448,9 @@ OpenSSL 0.9.x
14421448

14431449
<!-- Links -->
14441450

1451+
[CVE-2023-3817]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3817
1452+
[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446
1453+
[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975
14451454
[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
14461455
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
14471456
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466

deps/openssl/openssl/README-FIPS.md

Lines changed: 89 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ OpenSSL FIPS support
22
====================
33

44
This release of OpenSSL includes a cryptographic module that can be
5-
FIPS 140-2 validated. The module is implemented as an OpenSSL provider.
5+
FIPS validated. The module is implemented as an OpenSSL provider.
66
A provider is essentially a dynamically loadable module which implements
77
cryptographic algorithms, see the [README-PROVIDERS](README-PROVIDERS.md) file
88
for further details.
@@ -28,8 +28,16 @@ resp. `fips.dll` (on Windows). The FIPS provider does not get built and
2828
installed automatically. To enable it, you need to configure OpenSSL using
2929
the `enable-fips` option.
3030

31-
Installing the FIPS module
32-
==========================
31+
Installing the FIPS provider
32+
============================
33+
34+
In order to be FIPS compliant you must only use FIPS validated source code.
35+
Refer to <https://www.openssl.org/source/> for information related to
36+
which versions are FIPS validated. The instructions given below build OpenSSL
37+
just using the FIPS validated source code.
38+
39+
If you want to use a validated FIPS provider, but also want to use the latest
40+
OpenSSL release to build everything else, then refer to the next section.
3341

3442
The following is only a guide.
3543
Please read the Security Policy for up to date installation instructions.
@@ -63,19 +71,93 @@ the installation by doing the following two things:
6371

6472
- Runs the FIPS module self tests
6573
- Generates the so-called FIPS module configuration file containing information
66-
about the module such as the self test status, and the module checksum.
74+
about the module such as the module checksum (and for OpenSSL 3.0 the
75+
self test status).
6776

6877
The FIPS module must have the self tests run, and the FIPS module config file
69-
output generated on every machine that it is to be used on. You must not copy
70-
the FIPS module config file output data from one machine to another.
78+
output generated on every machine that it is to be used on. For OpenSSL 3.0,
79+
you must not copy the FIPS module config file output data from one machine to another.
7180

7281
On Unix the `openssl fipsinstall` command will be invoked as follows by default:
7382

7483
$ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so
7584

7685
If you configured OpenSSL to be installed to a different location, the paths will
7786
vary accordingly. In the rare case that you need to install the fipsmodule.cnf
78-
to non-standard location, you can execute the `openssl fipsinstall` command manually.
87+
to a non-standard location, you can execute the `openssl fipsinstall` command manually.
88+
89+
Installing the FIPS provider and using it with the latest release
90+
=================================================================
91+
92+
This normally requires you to download 2 copies of the OpenSSL source code.
93+
94+
Download and build a validated FIPS provider
95+
--------------------------------------------
96+
97+
Refer to <https://www.openssl.org/source/> for information related to
98+
which versions are FIPS validated. For this example we use OpenSSL 3.0.0.
99+
100+
$ wget https://www.openssl.org/source/openssl-3.0.0.tar.gz
101+
$ tar -xf openssl-3.0.0.tar.gz
102+
$ cd openssl-3.0.0
103+
$ ./Configure enable-fips
104+
$ make
105+
$ cd ..
106+
107+
Download and build the latest release of OpenSSL
108+
------------------------------------------------
109+
110+
We use OpenSSL 3.1.0 here, (but you could also use the latest 3.0.X)
111+
112+
$ wget https://www.openssl.org/source/openssl-3.1.0.tar.gz
113+
$ tar -xf openssl-3.1.0.tar.gz
114+
$ cd openssl-3.1.0
115+
$ ./Configure enable-fips
116+
$ make
117+
118+
Use the OpenSSL FIPS provider for testing
119+
-----------------------------------------
120+
121+
We do this by replacing the artifact for the OpenSSL 3.1.0 FIPS provider.
122+
Note that the OpenSSL 3.1.0 FIPS provider has not been validated
123+
so it must not be used for FIPS purposes.
124+
125+
$ cp ../openssl-3.0.0/providers/fips.so providers/.
126+
$ cp ../openssl-3.0.0/providers/fipsmodule.cnf providers/.
127+
// Note that for OpenSSL 3.0 that the `fipsmodule.cnf` file should not
128+
// be copied across multiple machines if it contains an entry for
129+
// `install-status`. (Otherwise the self tests would be skipped).
130+
131+
// Validate the output of the following to make sure we are using the
132+
// OpenSSL 3.0.0 FIPS provider
133+
$ ./util/wrap.pl -fips apps/openssl list -provider-path providers \
134+
-provider fips -providers
135+
136+
// Now run the current tests using the OpenSSL 3.0 FIPS provider.
137+
$ make tests
138+
139+
Copy the FIPS provider artifacts (`fips.so` & `fipsmodule.cnf`) to known locations
140+
-------------------------------------------------------------------------------------
141+
142+
$ cd ../openssl-3.0.0
143+
$ sudo make install_fips
144+
145+
Check that the correct FIPS provider is being used
146+
--------------------------------------------------
147+
148+
$./util/wrap.pl -fips apps/openssl list -provider-path providers \
149+
-provider fips -providers
150+
151+
// This should produce the following output
152+
Providers:
153+
base
154+
name: OpenSSL Base Provider
155+
version: 3.1.0
156+
status: active
157+
fips
158+
name: OpenSSL FIPS Provider
159+
version: 3.0.0
160+
status: active
79161

80162
Using the FIPS Module in applications
81163
=====================================

deps/openssl/openssl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ What This Is
44
This is a fork of [OpenSSL](https://www.openssl.org) to enable QUIC. In addition
55
to the website, the official source distribution is at
66
<https://github.com/openssl/openssl>. The OpenSSL `README` can be found at
7-
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.9%2Bquic/README-OpenSSL.md)
7+
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.10%2Bquic/README-OpenSSL.md)
88

99
This fork adds APIs that can be used by QUIC implementations for connection
1010
handshakes. Quoting the IETF Working group

deps/openssl/openssl/VERSION.dat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MAJOR=3
22
MINOR=0
3-
PATCH=9
3+
PATCH=10
44
PRE_RELEASE_TAG=
55
BUILD_METADATA=quic
6-
RELEASE_DATE="30 May 2023"
6+
RELEASE_DATE="1 Aug 2023"
77
SHLIB_VERSION=81.3

0 commit comments

Comments
 (0)