Skip to content

Commit 85f4548

Browse files
committed
deps: upgrade openssl sources to quictls/openssl-3.0.7+quic
This updates all sources in deps/openssl/openssl by: $ git clone [email protected]:quictls/openssl.git $ cd openssl $ git checkout openssl-3.0.7+quic $ cd ../node/deps/openssl $ rm -rf openssl $ cp -R ../../../openssl openssl $ rm -rf openssl/.git* openssl/.travis* $ git add --all openssl $ git commit openssl CVE-ID: CVE-2022-3602, CVE-2022-3786 PR-URL: #45286
1 parent 43403f5 commit 85f4548

File tree

296 files changed

+55895
-2027
lines changed

Some content is hidden

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

296 files changed

+55895
-2027
lines changed

deps/openssl/openssl/CHANGES.md

+158-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,169 @@ 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.5 and 3.0.5+quic [5 Jul 2022]
31+
### Changes between 3.0.7 and 3.0.7+quic [1 Nov 2022]
3232

3333
* Add QUIC API support from BoringSSL.
3434

3535
*Todd Short*
3636

37+
### Changes between 3.0.6 and 3.0.7 [1 Nov 2022]
38+
39+
* Fixed two buffer overflows in punycode decoding functions.
40+
41+
A buffer overrun can be triggered in X.509 certificate verification,
42+
specifically in name constraint checking. Note that this occurs after
43+
certificate chain signature verification and requires either a CA to
44+
have signed the malicious certificate or for the application to continue
45+
certificate verification despite failure to construct a path to a trusted
46+
issuer.
47+
48+
In a TLS client, this can be triggered by connecting to a malicious
49+
server. In a TLS server, this can be triggered if the server requests
50+
client authentication and a malicious client connects.
51+
52+
An attacker can craft a malicious email address to overflow
53+
an arbitrary number of bytes containing the `.` character (decimal 46)
54+
on the stack. This buffer overflow could result in a crash (causing a
55+
denial of service).
56+
([CVE-2022-3786])
57+
58+
An attacker can craft a malicious email address to overflow four
59+
attacker-controlled bytes on the stack. This buffer overflow could
60+
result in a crash (causing a denial of service) or potentially remote code
61+
execution depending on stack layout for any given platform/compiler.
62+
([CVE-2022-3602])
63+
64+
*Paul Dale*
65+
66+
* Removed all references to invalid OSSL_PKEY_PARAM_RSA names for CRT
67+
parameters in OpenSSL code.
68+
Applications should not use the names OSSL_PKEY_PARAM_RSA_FACTOR,
69+
OSSL_PKEY_PARAM_RSA_EXPONENT and OSSL_PKEY_PARAM_RSA_COEFFICIENT.
70+
Use the numbered names such as OSSL_PKEY_PARAM_RSA_FACTOR1 instead.
71+
Using these invalid names may cause algorithms to use slower methods
72+
that ignore the CRT parameters.
73+
74+
*Shane Lontis*
75+
76+
* Fixed a regression introduced in 3.0.6 version raising errors on some stack
77+
operations.
78+
79+
*Tomáš Mráz*
80+
81+
* Fixed a regression introduced in 3.0.6 version not refreshing the certificate
82+
data to be signed before signing the certificate.
83+
84+
*Gibeom Gwon*
85+
86+
* Added RIPEMD160 to the default provider.
87+
88+
*Paul Dale*
89+
90+
* Ensured that the key share group sent or accepted for the key exchange
91+
is allowed for the protocol version.
92+
93+
*Matt Caswell*
94+
95+
### Changes between 3.0.5 and 3.0.6 [11 Oct 2022]
96+
97+
* OpenSSL supports creating a custom cipher via the legacy
98+
EVP_CIPHER_meth_new() function and associated function calls. This function
99+
was deprecated in OpenSSL 3.0 and application authors are instead encouraged
100+
to use the new provider mechanism in order to implement custom ciphers.
101+
102+
OpenSSL versions 3.0.0 to 3.0.5 incorrectly handle legacy custom ciphers
103+
passed to the EVP_EncryptInit_ex2(), EVP_DecryptInit_ex2() and
104+
EVP_CipherInit_ex2() functions (as well as other similarly named encryption
105+
and decryption initialisation functions). Instead of using the custom cipher
106+
directly it incorrectly tries to fetch an equivalent cipher from the
107+
available providers. An equivalent cipher is found based on the NID passed to
108+
EVP_CIPHER_meth_new(). This NID is supposed to represent the unique NID for a
109+
given cipher. However it is possible for an application to incorrectly pass
110+
NID_undef as this value in the call to EVP_CIPHER_meth_new(). When NID_undef
111+
is used in this way the OpenSSL encryption/decryption initialisation function
112+
will match the NULL cipher as being equivalent and will fetch this from the
113+
available providers. This will succeed if the default provider has been
114+
loaded (or if a third party provider has been loaded that offers this
115+
cipher). Using the NULL cipher means that the plaintext is emitted as the
116+
ciphertext.
117+
118+
Applications are only affected by this issue if they call
119+
EVP_CIPHER_meth_new() using NID_undef and subsequently use it in a call to an
120+
encryption/decryption initialisation function. Applications that only use
121+
SSL/TLS are not impacted by this issue.
122+
([CVE-2022-3358])
123+
124+
*Matt Caswell*
125+
126+
* Fix LLVM vs Apple LLVM version numbering confusion that caused build failures
127+
on MacOS 10.11
128+
129+
*Richard Levitte*
130+
131+
* Fixed the linux-mips64 Configure target which was missing the
132+
SIXTY_FOUR_BIT bn_ops flag. This was causing heap corruption on that
133+
platform.
134+
135+
*Adam Joseph*
136+
137+
* Fix handling of a ticket key callback that returns 0 in TLSv1.3 to not send a
138+
ticket
139+
140+
*Matt Caswell*
141+
142+
* Correctly handle a retransmitted ClientHello in DTLS
143+
144+
*Matt Caswell*
145+
146+
* Fixed detection of ktls support in cross-compile environment on Linux
147+
148+
*Tomas Mraz*
149+
150+
* Fixed some regressions and test failures when running the 3.0.0 FIPS provider
151+
against 3.0.x
152+
153+
*Paul Dale*
154+
155+
* Fixed SSL_pending() and SSL_has_pending() with DTLS which were failing to
156+
report correct results in some cases
157+
158+
*Matt Caswell*
159+
160+
* Fix UWP builds by defining VirtualLock
161+
162+
*Charles Milette*
163+
164+
* For known safe primes use the minimum key length according to RFC 7919.
165+
Longer private key sizes unnecessarily raise the cycles needed to compute the
166+
shared secret without any increase of the real security. This fixes a
167+
regression from 1.1.1 where these shorter keys were generated for the known
168+
safe primes.
169+
170+
*Tomas Mraz*
171+
172+
* Added the loongarch64 target
173+
174+
*Shi Pujin*
175+
176+
* Fixed EC ASM flag passing. Flags for ASM implementations of EC curves were
177+
only passed to the FIPS provider and not to the default or legacy provider.
178+
179+
*Juergen Christ*
180+
181+
* Fixed reported performance degradation on aarch64. Restored the
182+
implementation prior to commit 2621751 ("aes/asm/aesv8-armx.pl: avoid
183+
32-bit lane assignment in CTR mode") for 64bit targets only, since it is
184+
reportedly 2-17% slower and the silicon errata only affects 32bit targets.
185+
The new algorithm is still used for 32 bit targets.
186+
187+
*Bernd Edlinger*
188+
189+
* Added a missing header for memcmp that caused compilation failure on some
190+
platforms
191+
192+
*Gregor Jasny*
193+
37194
### Changes between 3.0.4 and 3.0.5 [5 Jul 2022]
38195

39196
* The OpenSSL 3.0.4 release introduced a serious bug in the RSA

deps/openssl/openssl/Configurations/10-main.conf

+10-3
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ my %targets = (
797797
inherit_from => [ "linux-latomic" ],
798798
cflags => add("-mabi=n32"),
799799
cxxflags => add("-mabi=n32"),
800-
bn_ops => "RC4_CHAR",
800+
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
801801
asm_arch => 'mips64',
802802
perlasm_scheme => "n32",
803803
multilib => "32",
@@ -818,6 +818,13 @@ my %targets = (
818818
perlasm_scheme => "linux64",
819819
},
820820

821+
# loongarch64 below refers to contemporary LoongArch Architecture
822+
# specifications,
823+
"linux64-loongarch64" => {
824+
inherit_from => [ "linux-generic64"],
825+
perlasm_scheme => "linux64",
826+
},
827+
821828
#### IA-32 targets...
822829
#### These two targets are a bit aged and are to be used on older Linux
823830
#### machines where gcc doesn't understand -m32 and -m64
@@ -1302,7 +1309,7 @@ my %targets = (
13021309
inherit_from => [ "BASE_Windows" ],
13031310
template => 1,
13041311
CC => "cl",
1305-
CPP => '"$(CC)" /EP /C',
1312+
CPP => '$(CC) /EP /C',
13061313
CFLAGS => "/W3 /wd4090 /nologo",
13071314
coutflag => "/Fo",
13081315
LD => "link",
@@ -1311,7 +1318,7 @@ my %targets = (
13111318
ldpostoutflag => "",
13121319
ld_resp_delim => "\n",
13131320
bin_lflags => "setargv.obj",
1314-
makedepcmd => '"$(CC)" /Zs /showIncludes',
1321+
makedepcmd => '$(CC) /Zs /showIncludes',
13151322
makedep_scheme => 'VC',
13161323
AR => "lib",
13171324
ARFLAGS => "/nologo",

deps/openssl/openssl/Configurations/50-djgpp.conf

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
my %targets = (
66
"DJGPP" => {
7+
inherit_from => [ "BASE_unix" ],
78
CC => "gcc",
89
CFLAGS => "-fomit-frame-pointer -O2 -Wall",
910
cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN",

deps/openssl/openssl/Configurations/windows-makefile.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ uninstall_docs: uninstall_html_docs
500500
{- output_off() if $disabled{fips}; "" -}
501501
install_fips: build_sw $(INSTALL_FIPSMODULECONF)
502502
# @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
503-
@$(PERL) $(SRCDIR)\util\mkdir-p.pl $(MODULESDIR)
504-
@$(PERL) $(SRCDIR)\util\mkdir-p.pl $(OPENSSLDIR)
503+
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
504+
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)"
505505
@$(ECHO) "*** Installing FIPS module"
506506
@$(ECHO) "install $(INSTALL_FIPSMODULE) -> $(MODULESDIR)\$(FIPSMODULENAME)"
507507
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(INSTALL_FIPSMODULE)" "$(MODULESDIR)"
@@ -742,7 +742,7 @@ EOF
742742
rel2abs($config{builddir}));
743743
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION_NUMBER)' : '';
744744
my $ord_name =
745-
$args{generator}->[1] || platform->dsoname($args{product});
745+
$args{generator}->[1] || basename(platform->dsoname($args{product}));
746746
return <<"EOF";
747747
$target: $gen0 $deps $mkdef
748748
"\$(PERL)" "$mkdef"$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name --OS windows > $target

deps/openssl/openssl/Configure

+16-65
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use lib "$FindBin::Bin/util/perl";
1717
use File::Basename;
1818
use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs splitdir/;
1919
use File::Path qw/mkpath/;
20-
use File::Compare qw(compare_text);
2120
use OpenSSL::fallback "$FindBin::Bin/external/perl/MODULES.txt";
2221
use OpenSSL::Glob;
2322
use OpenSSL::Template;
@@ -1506,9 +1505,7 @@ unless ($disabled{asan} || defined $detected_sanitizers{asan}) {
15061505
}
15071506

15081507
unless ($disabled{ubsan} || defined $detected_sanitizers{ubsan}) {
1509-
# -DPEDANTIC or -fnosanitize=alignment may also be required on some
1510-
# platforms.
1511-
push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all";
1508+
push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all", "-DPEDANTIC";
15121509
}
15131510

15141511
unless ($disabled{msan} || defined $detected_sanitizers{msan}) {
@@ -1720,20 +1717,13 @@ unless ($disabled{devcryptoeng}) {
17201717

17211718
unless ($disabled{ktls}) {
17221719
$config{ktls}="";
1720+
my $cc = $config{CROSS_COMPILE}.$config{CC};
17231721
if ($target =~ m/^linux/) {
1724-
my $usr = "/usr/$config{cross_compile_prefix}";
1725-
chop($usr);
1726-
if ($config{cross_compile_prefix} eq "") {
1727-
$usr = "/usr";
1728-
}
1729-
my $minver = (4 << 16) + (13 << 8) + 0;
1730-
my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`);
1731-
1732-
if ($verstr[2] < $minver) {
1722+
system("printf '#include <sys/types.h>\n#include <linux/tls.h>' | $cc -E - >/dev/null 2>&1");
1723+
if ($? != 0) {
17331724
disable('too-old-kernel', 'ktls');
17341725
}
17351726
} elsif ($target =~ m/^BSD/) {
1736-
my $cc = $config{CROSS_COMPILE}.$config{CC};
17371727
system("printf '#include <sys/types.h>\n#include <sys/ktls.h>' | $cc -E - >/dev/null 2>&1");
17381728
if ($? != 0) {
17391729
disable('too-old-freebsd', 'ktls');
@@ -2852,59 +2842,20 @@ $configdata_tmpl->fill_in(
28522842
) or die $Text::Template::ERROR;
28532843
close CONFIGDATA;
28542844

2855-
# When using stat() on Windows, we can get it to perform better by avoid some
2856-
# data. This doesn't affect the mtime field, so we're not losing anything...
2857-
${^WIN32_SLOPPY_STAT} = 1;
2858-
2859-
my $update_configdata = 0;
2860-
my $run_configdata = 0;
2861-
if (-f $configdata_outname) {
2862-
my $Configure_mtime = (stat($0))[9];
2863-
my $configdata_mtime = (stat($configdata_outname))[9];
2864-
2865-
# If this script was updated after the last configdata.pm, or if
2866-
# configdata.pm.new differs from configdata.pm, we update configdata.pm
2867-
if ($configdata_mtime < $Configure_mtime
2868-
|| compare_text("$configdata_outname.new", $configdata_outname) != 0) {
2869-
$update_configdata = 1;
2870-
} else {
2871-
# If nothing has changed, let's just drop the new one and pretend
2872-
# like nothing happened
2873-
unlink "$configdata_outname.new";
2874-
2875-
# We still run configdata.pm if one of the build file (Makefile) or
2876-
# the configuration header file are missing
2877-
$run_configdata =
2878-
!( -f $target{build_file} )
2879-
|| !( -f catfile('include', 'openssl', 'configuration.h') );
2880-
}
2881-
} else {
2882-
$update_configdata = 1;
2883-
}
2884-
2885-
if ($update_configdata) {
2886-
# If something did change, or there was no previous configdata.pm, we
2887-
# rename the new one, set permissions as needed, and run it.
2888-
rename "$configdata_outname.new", $configdata_outname;
2889-
if ($builder_platform eq 'unix') {
2890-
my $mode = (0755 & ~umask);
2891-
chmod $mode, 'configdata.pm'
2892-
or warn sprintf("WARNING: Couldn't change mode for 'configdata.pm' to 0%03o: %s\n",$mode,$!);
2893-
}
2894-
$run_configdata = 1;
2895-
print "Created $configdata_outname\n";
2845+
rename "$configdata_outname.new", $configdata_outname;
2846+
if ($builder_platform eq 'unix') {
2847+
my $mode = (0755 & ~umask);
2848+
chmod $mode, 'configdata.pm'
2849+
or warn sprintf("WARNING: Couldn't change mode for 'configdata.pm' to 0%03o: %s\n",$mode,$!);
28962850
}
2851+
print "Created $configdata_outname\n";
28972852

2898-
if ($run_configdata) {
2899-
print "Running $configdata_outname\n";
2900-
my $perlcmd = (quotify("maybeshell", $config{PERL}))[0];
2901-
my $cmd = "$perlcmd $configdata_outname";
2902-
#print STDERR "DEBUG[run_dofile]: \$cmd = $cmd\n";
2903-
system($cmd);
2904-
exit 1 if $? != 0;
2905-
} else {
2906-
print "No changes in $configdata_outname, no need to run it\n";
2907-
}
2853+
print "Running $configdata_outname\n";
2854+
my $perlcmd = (quotify("maybeshell", $config{PERL}))[0];
2855+
my $cmd = "$perlcmd $configdata_outname";
2856+
#print STDERR "DEBUG[run_dofile]: \$cmd = $cmd\n";
2857+
system($cmd);
2858+
exit 1 if $? != 0;
29082859

29092860
$SIG{__DIE__} = $orig_death_handler;
29102861

deps/openssl/openssl/INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ the individual protocol versions.
978978

979979
### no-{protocol}-method
980980

981-
no-{ssl|ssl3|tls|tls1|tls1_1|tls1_2|tls1_3|dtls|dtls1|dtls1_2}-method
981+
no-{ssl3|tls1|tls1_1|tls1_2|dtls1|dtls1_2}-method
982982

983983
Analogous to `no-{protocol}` but in addition do not build the methods for
984984
applications to explicitly select individual protocol versions. Note that there

deps/openssl/openssl/NEWS.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@ OpenSSL Releases
1818
OpenSSL 3.0
1919
-----------
2020

21+
### Major changes between OpenSSL 3.0.6 and OpenSSL 3.0.7 [1 Nov 2022]
22+
23+
* Added RIPEMD160 to the default provider.
24+
* Fixed regressions introduced in 3.0.6 version.
25+
* Fixed two buffer overflows in punycode decoding functions.
26+
([CVE-2022-3786]) and ([CVE-2022-3602])
27+
28+
### Major changes between OpenSSL 3.0.5 and OpenSSL 3.0.6 [11 Oct 2022]
29+
30+
* Fix for custom ciphers to prevent accidental use of NULL encryption
31+
([CVE-2022-3358])
32+
2133
### Major changes between OpenSSL 3.0.4 and OpenSSL 3.0.5 [5 Jul 2022]
2234

2335
* Fixed heap memory corruption with RSA private key operation
2436
([CVE-2022-2274])
2537
* Fixed AES OCB failure to encrypt some bytes on 32-bit x86 platforms
2638
([CVE-2022-2097])
2739

28-
2940
### Major changes between OpenSSL 3.0.3 and OpenSSL 3.0.4 [21 Jun 2022]
3041

3142
* Fixed additional bugs in the c_rehash script which was not properly

deps/openssl/openssl/README-ENGINES.md

-1
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,3 @@ It seems like the ENGINE part doesn't work too well with CryptoSwift on Win32.
314314
A quick test done right before the release showed that trying "openssl speed
315315
-engine cswift" generated errors. If the DSO gets enabled, an attempt is made
316316
to write at memory address 0x00000002.
317-

0 commit comments

Comments
 (0)