Skip to content

Commit 60d7d41

Browse files
committed
deps: upgrade openssl sources to 1.1.1m
This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1m.tar.gz $ mv openssl-1.1.1m openssl $ git add --all openssl $ git commit openssl PR-URL: #41172 Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000211.html Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 243b2fb commit 60d7d41

Some content is hidden

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

95 files changed

+1180
-322
lines changed

deps/openssl/openssl/CHANGES

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

10+
Changes between 1.1.1l and 1.1.1m [14 Dec 2021]
11+
12+
*) Avoid loading of a dynamic engine twice.
13+
14+
[Bernd Edlinger]
15+
16+
*) Fixed building on Debian with kfreebsd kernels
17+
18+
[Mattias Ellert]
19+
20+
*) Prioritise DANE TLSA issuer certs over peer certs
21+
22+
[Viktor Dukhovni]
23+
24+
*) Fixed random API for MacOS prior to 10.12
25+
26+
These MacOS versions don't support the CommonCrypto APIs
27+
28+
[Lenny Primak]
29+
1030
Changes between 1.1.1k and 1.1.1l [24 Aug 2021]
1131

1232
*) Fixed an SM2 Decryption Buffer Overflow.

deps/openssl/openssl/Configure

+3
Original file line numberDiff line numberDiff line change
@@ -1304,16 +1304,19 @@ if ($disabled{"dynamic-engine"}) {
13041304

13051305
unless ($disabled{asan}) {
13061306
push @{$config{cflags}}, "-fsanitize=address";
1307+
push @{$config{cxxflags}}, "-fsanitize=address" if $config{CXX};
13071308
}
13081309

13091310
unless ($disabled{ubsan}) {
13101311
# -DPEDANTIC or -fnosanitize=alignment may also be required on some
13111312
# platforms.
13121313
push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all";
1314+
push @{$config{cxxflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all" if $config{CXX};
13131315
}
13141316

13151317
unless ($disabled{msan}) {
13161318
push @{$config{cflags}}, "-fsanitize=memory";
1319+
push @{$config{cxxflags}}, "-fsanitize=memory" if $config{CXX};
13171320
}
13181321

13191322
unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}

deps/openssl/openssl/NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
This file gives a brief overview of the major changes between each OpenSSL
66
release. For more details please read the CHANGES file.
77

8+
Major changes between OpenSSL 1.1.1l and OpenSSL 1.1.1m [14 Dec 2021]
9+
10+
o None
11+
812
Major changes between OpenSSL 1.1.1k and OpenSSL 1.1.1l [24 Aug 2021]
913

1014
o Fixed an SM2 Decryption Buffer Overflow (CVE-2021-3711)

deps/openssl/openssl/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OpenSSL 1.1.1l 24 Aug 2021
2+
OpenSSL 1.1.1m 14 Dec 2021
33

44
Copyright (c) 1998-2021 The OpenSSL Project
55
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson

deps/openssl/openssl/apps/ciphers.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -172,6 +172,7 @@ int ciphers_main(int argc, char **argv)
172172
if (convert != NULL) {
173173
BIO_printf(bio_out, "OpenSSL cipher name: %s\n",
174174
OPENSSL_cipher_name(convert));
175+
ret = 0;
175176
goto end;
176177
}
177178

deps/openssl/openssl/apps/dgst.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -316,7 +316,7 @@ int dgst_main(int argc, char **argv)
316316
EVP_MD_CTX *mctx = NULL;
317317
EVP_PKEY_CTX *pctx = NULL;
318318
int r;
319-
if (!BIO_get_md_ctx(bmd, &mctx)) {
319+
if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
320320
BIO_printf(bio_err, "Error getting context\n");
321321
ERR_print_errors(bio_err);
322322
goto end;
@@ -345,7 +345,7 @@ int dgst_main(int argc, char **argv)
345345
/* we use md as a filter, reading from 'in' */
346346
else {
347347
EVP_MD_CTX *mctx = NULL;
348-
if (!BIO_get_md_ctx(bmd, &mctx)) {
348+
if (BIO_get_md_ctx(bmd, &mctx) <= 0) {
349349
BIO_printf(bio_err, "Error getting context\n");
350350
ERR_print_errors(bio_err);
351351
goto end;

deps/openssl/openssl/apps/s_cb.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
819819
{
820820
unsigned int temp;
821821
int res = generate_cookie_callback(ssl, cookie, &temp);
822-
*cookie_len = temp;
822+
823+
if (res != 0)
824+
*cookie_len = temp;
823825
return res;
824826
}
825827

deps/openssl/openssl/apps/s_client.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
* Copyright 2005 Nokia. All rights reserved.
44
*
55
* Licensed under the OpenSSL license (the "License"). You may not use
@@ -3151,6 +3151,8 @@ int s_client_main(int argc, char **argv)
31513151
#endif
31523152
OPENSSL_free(connectstr);
31533153
OPENSSL_free(bindstr);
3154+
OPENSSL_free(bindhost);
3155+
OPENSSL_free(bindport);
31543156
OPENSSL_free(host);
31553157
OPENSSL_free(port);
31563158
X509_VERIFY_PARAM_free(vpm);

deps/openssl/openssl/apps/s_server.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
134134
if (s_debug)
135135
BIO_printf(bio_s_out, "psk_server_cb\n");
136136

137-
if (SSL_version(ssl) >= TLS1_3_VERSION) {
137+
if (!SSL_is_dtls(ssl) && SSL_version(ssl) >= TLS1_3_VERSION) {
138138
/*
139-
* This callback is designed for use in TLSv1.2. It is possible to use
140-
* a single callback for all protocol versions - but it is preferred to
141-
* use a dedicated callback for TLSv1.3. For TLSv1.3 we have
142-
* psk_find_session_cb.
139+
* This callback is designed for use in (D)TLSv1.2 (or below). It is
140+
* possible to use a single callback for all protocol versions - but it
141+
* is preferred to use a dedicated callback for TLSv1.3. For TLSv1.3 we
142+
* have psk_find_session_cb.
143143
*/
144144
return 0;
145145
}

deps/openssl/openssl/apps/speed.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
44
*
55
* Licensed under the OpenSSL license (the "License"). You may not use
@@ -1590,6 +1590,10 @@ int speed_main(int argc, char **argv)
15901590
case OPT_MULTI:
15911591
#ifndef NO_FORK
15921592
multi = atoi(opt_arg());
1593+
if (multi >= INT_MAX / (int)sizeof(int)) {
1594+
BIO_printf(bio_err, "%s: multi argument too large\n", prog);
1595+
return 0;
1596+
}
15931597
#endif
15941598
break;
15951599
case OPT_ASYNCJOBS:
@@ -3490,7 +3494,7 @@ static int do_multi(int multi, int size_num)
34903494
close(fd[1]);
34913495
mr = 1;
34923496
usertime = 0;
3493-
free(fds);
3497+
OPENSSL_free(fds);
34943498
return 0;
34953499
}
34963500
printf("Forked child %d\n", n);
@@ -3603,7 +3607,7 @@ static int do_multi(int multi, int size_num)
36033607

36043608
fclose(f);
36053609
}
3606-
free(fds);
3610+
OPENSSL_free(fds);
36073611
return 1;
36083612
}
36093613
#endif

deps/openssl/openssl/crypto/armcap.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,23 @@ static unsigned long getauxval(unsigned long key)
106106
* ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas
107107
* AArch64 used AT_HWCAP.
108108
*/
109+
# ifndef AT_HWCAP
110+
# define AT_HWCAP 16
111+
# endif
112+
# ifndef AT_HWCAP2
113+
# define AT_HWCAP2 26
114+
# endif
109115
# if defined(__arm__) || defined (__arm)
110-
# define HWCAP 16
111-
/* AT_HWCAP */
116+
# define HWCAP AT_HWCAP
112117
# define HWCAP_NEON (1 << 12)
113118

114-
# define HWCAP_CE 26
115-
/* AT_HWCAP2 */
119+
# define HWCAP_CE AT_HWCAP2
116120
# define HWCAP_CE_AES (1 << 0)
117121
# define HWCAP_CE_PMULL (1 << 1)
118122
# define HWCAP_CE_SHA1 (1 << 2)
119123
# define HWCAP_CE_SHA256 (1 << 3)
120124
# elif defined(__aarch64__)
121-
# define HWCAP 16
122-
/* AT_HWCAP */
125+
# define HWCAP AT_HWCAP
123126
# define HWCAP_NEON (1 << 1)
124127

125128
# define HWCAP_CE HWCAP

deps/openssl/openssl/crypto/asn1/a_print.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -18,12 +18,13 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
1818
int ia5 = 0;
1919
int t61 = 0;
2020

21-
if (len <= 0)
22-
len = -1;
2321
if (s == NULL)
2422
return V_ASN1_PRINTABLESTRING;
2523

26-
while ((*s) && (len-- != 0)) {
24+
if (len < 0)
25+
len = strlen((const char *)s);
26+
27+
while (len-- > 0) {
2728
c = *(s++);
2829
if (!ossl_isasn1print(c))
2930
ia5 = 1;

deps/openssl/openssl/crypto/asn1/asn1_lib.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
294294
c = str->data;
295295
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
296296
/* No NUL terminator in fuzzing builds */
297-
str->data = OPENSSL_realloc(c, len);
297+
str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
298298
#else
299299
str->data = OPENSSL_realloc(c, len + 1);
300300
#endif
@@ -307,7 +307,11 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len_in)
307307
str->length = len;
308308
if (data != NULL) {
309309
memcpy(str->data, data, len);
310-
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
310+
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
311+
/* Set the unused byte to something non NUL and printable. */
312+
if (len == 0)
313+
str->data[len] = '~';
314+
#else
311315
/*
312316
* Add a NUL terminator. This should not be necessary - but we add it as
313317
* a safety precaution
@@ -375,7 +379,8 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
375379

376380
i = (a->length - b->length);
377381
if (i == 0) {
378-
i = memcmp(a->data, b->data, a->length);
382+
if (a->length != 0)
383+
i = memcmp(a->data, b->data, a->length);
379384
if (i == 0)
380385
return a->type - b->type;
381386
else

deps/openssl/openssl/crypto/bio/bss_dgram.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/*
2-
* Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
66
* in the file LICENSE in the source distribution or at
77
* https://www.openssl.org/source/license.html
88
*/
99

10+
#ifndef _GNU_SOURCE
11+
# define _GNU_SOURCE
12+
#endif
13+
1014
#include <stdio.h>
1115
#include <errno.h>
1216

deps/openssl/openssl/crypto/bio/bss_mem.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -280,7 +280,7 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
280280
ret = (long)bm->length;
281281
if (ptr != NULL) {
282282
pptr = (char **)ptr;
283-
*pptr = (char *)&(bm->data[0]);
283+
*pptr = (char *)bm->data;
284284
}
285285
break;
286286
case BIO_C_SET_BUF_MEM:

deps/openssl/openssl/crypto/bn/asm/mips.pl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env perl
2-
# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
2+
# Copyright 2010-2021 The OpenSSL Project Authors. All Rights Reserved.
33
#
44
# Licensed under the OpenSSL license (the "License"). You may not use
55
# this file except in compliance with the License. You can obtain a copy
@@ -1984,6 +1984,8 @@ ()
19841984
sltu $at,$c_2,$t_1
19851985
$ADDU $c_3,$t_2,$at
19861986
$ST $c_2,$BNSZ($a0)
1987+
sltu $at,$c_3,$t_2
1988+
$ADDU $c_1,$at
19871989
mflo ($t_1,$a_2,$a_0)
19881990
mfhi ($t_2,$a_2,$a_0)
19891991
___
@@ -2194,6 +2196,8 @@ ()
21942196
sltu $at,$c_2,$t_1
21952197
$ADDU $c_3,$t_2,$at
21962198
$ST $c_2,$BNSZ($a0)
2199+
sltu $at,$c_3,$t_2
2200+
$ADDU $c_1,$at
21972201
mflo ($t_1,$a_2,$a_0)
21982202
mfhi ($t_2,$a_2,$a_0)
21992203
___

deps/openssl/openssl/crypto/cms/cms_env.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -737,6 +737,7 @@ static int cms_RecipientInfo_kekri_decrypt(CMS_ContentInfo *cms,
737737
goto err;
738738
}
739739

740+
OPENSSL_clear_free(ec->key, ec->keylen);
740741
ec->key = ukey;
741742
ec->keylen = ukeylen;
742743

deps/openssl/openssl/crypto/dh/dh_ameth.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the OpenSSL license (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -629,16 +629,18 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
629629
goto err;
630630

631631
pk = EVP_PKEY_CTX_get0_pkey(pctx);
632-
if (!pk)
633-
goto err;
634-
if (pk->type != EVP_PKEY_DHX)
632+
if (pk == NULL || pk->type != EVP_PKEY_DHX)
635633
goto err;
634+
636635
/* Get parameters from parent key */
637636
dhpeer = DHparams_dup(pk->pkey.dh);
637+
if (dhpeer == NULL)
638+
goto err;
639+
638640
/* We have parameters now set public key */
639641
plen = ASN1_STRING_length(pubkey);
640642
p = ASN1_STRING_get0_data(pubkey);
641-
if (!p || !plen)
643+
if (p == NULL || plen == 0)
642644
goto err;
643645

644646
if ((public_key = d2i_ASN1_INTEGER(NULL, &p, plen)) == NULL) {
@@ -655,6 +657,7 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
655657
pkpeer = EVP_PKEY_new();
656658
if (pkpeer == NULL)
657659
goto err;
660+
658661
EVP_PKEY_assign(pkpeer, pk->ameth->pkey_id, dhpeer);
659662
dhpeer = NULL;
660663
if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0)

deps/openssl/openssl/crypto/ec/curve448/field.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
33
* Copyright 2014 Cryptography Research, Inc.
44
*
55
* Licensed under the OpenSSL license (the "License"). You may not use
@@ -62,7 +62,7 @@ mask_t gf_eq(const gf x, const gf y);
6262
mask_t gf_lobit(const gf x);
6363
mask_t gf_hibit(const gf x);
6464

65-
void gf_serialize(uint8_t *serial, const gf x, int with_highbit);
65+
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
6666
mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
6767
uint8_t hi_nmask);
6868

0 commit comments

Comments
 (0)