Skip to content

Commit 7a95637

Browse files
richardlauMylesBorins
authored andcommittedAug 28, 2021
deps: upgrade openssl sources to 1.1.1l
This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1l.tar.gz $ mv openssl-1.1.1l openssl $ git add --all openssl $ git commit openssl PR-URL: #39869 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 840b0ff commit 7a95637

Some content is hidden

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

107 files changed

+2009
-525
lines changed
 

Diff for: ‎deps/openssl/openssl/CHANGES

+65
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,71 @@
77
https://github.com/openssl/openssl/commits/ and pick the appropriate
88
release branch.
99

10+
Changes between 1.1.1k and 1.1.1l [24 Aug 2021]
11+
12+
*) Fixed an SM2 Decryption Buffer Overflow.
13+
14+
In order to decrypt SM2 encrypted data an application is expected to call the
15+
API function EVP_PKEY_decrypt(). Typically an application will call this
16+
function twice. The first time, on entry, the "out" parameter can be NULL and,
17+
on exit, the "outlen" parameter is populated with the buffer size required to
18+
hold the decrypted plaintext. The application can then allocate a sufficiently
19+
sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL
20+
value for the "out" parameter.
21+
22+
A bug in the implementation of the SM2 decryption code means that the
23+
calculation of the buffer size required to hold the plaintext returned by the
24+
first call to EVP_PKEY_decrypt() can be smaller than the actual size required by
25+
the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is
26+
called by the application a second time with a buffer that is too small.
27+
28+
A malicious attacker who is able present SM2 content for decryption to an
29+
application could cause attacker chosen data to overflow the buffer by up to a
30+
maximum of 62 bytes altering the contents of other data held after the
31+
buffer, possibly changing application behaviour or causing the application to
32+
crash. The location of the buffer is application dependent but is typically
33+
heap allocated.
34+
(CVE-2021-3711)
35+
[Matt Caswell]
36+
37+
*) Fixed various read buffer overruns processing ASN.1 strings
38+
39+
ASN.1 strings are represented internally within OpenSSL as an ASN1_STRING
40+
structure which contains a buffer holding the string data and a field holding
41+
the buffer length. This contrasts with normal C strings which are repesented as
42+
a buffer for the string data which is terminated with a NUL (0) byte.
43+
44+
Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's
45+
own "d2i" functions (and other similar parsing functions) as well as any string
46+
whose value has been set with the ASN1_STRING_set() function will additionally
47+
NUL terminate the byte array in the ASN1_STRING structure.
48+
49+
However, it is possible for applications to directly construct valid ASN1_STRING
50+
structures which do not NUL terminate the byte array by directly setting the
51+
"data" and "length" fields in the ASN1_STRING array. This can also happen by
52+
using the ASN1_STRING_set0() function.
53+
54+
Numerous OpenSSL functions that print ASN.1 data have been found to assume that
55+
the ASN1_STRING byte array will be NUL terminated, even though this is not
56+
guaranteed for strings that have been directly constructed. Where an application
57+
requests an ASN.1 structure to be printed, and where that ASN.1 structure
58+
contains ASN1_STRINGs that have been directly constructed by the application
59+
without NUL terminating the "data" field, then a read buffer overrun can occur.
60+
61+
The same thing can also occur during name constraints processing of certificates
62+
(for example if a certificate has been directly constructed by the application
63+
instead of loading it via the OpenSSL parsing functions, and the certificate
64+
contains non NUL terminated ASN1_STRING structures). It can also occur in the
65+
X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions.
66+
67+
If a malicious actor can cause an application to directly construct an
68+
ASN1_STRING and then process it through one of the affected OpenSSL functions
69+
then this issue could be hit. This might result in a crash (causing a Denial of
70+
Service attack). It could also result in the disclosure of private memory
71+
contents (such as private keys, or sensitive plaintext).
72+
(CVE-2021-3712)
73+
[Matt Caswell]
74+
1075
Changes between 1.1.1j and 1.1.1k [25 Mar 2021]
1176

1277
*) Fixed a problem with verifying a certificate chain when using the

Diff for: ‎deps/openssl/openssl/Configurations/10-main.conf

+7
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,13 @@ my %targets = (
754754
multilib => "64",
755755
},
756756

757+
# riscv64 below refers to contemporary RISCV Architecture
758+
# specifications,
759+
"linux64-riscv64" => {
760+
inherit_from => [ "linux-generic64"],
761+
perlasm_scheme => "linux64",
762+
},
763+
757764
#### IA-32 targets...
758765
#### These two targets are a bit aged and are to be used on older Linux
759766
#### machines where gcc doesn't understand -m32 and -m64

0 commit comments

Comments
 (0)