Skip to content

Commit 7f9a5ed

Browse files
committed
deps: upgrade openssl sources to 1.1.1o
This updates all sources in deps/openssl/openssl by: $ cd deps/openssl/ $ rm -rf openssl $ tar zxf ~/tmp/openssl-1.1.1o.tar.gz $ mv openssl-1.1.1o openssl $ git add --all openssl $ git commit openssl PR-URL: #42956 Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-May/000223.html Reviewed-By: Beth Griggs <bgriggs@redhat.com>
1 parent 20c299b commit 7f9a5ed

38 files changed

+685
-115
lines changed

deps/openssl/openssl/CHANGES

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

10+
Changes between 1.1.1n and 1.1.1o [3 May 2022]
11+
12+
*) Fixed a bug in the c_rehash script which was not properly sanitising shell
13+
metacharacters to prevent command injection. This script is distributed by
14+
some operating systems in a manner where it is automatically executed. On
15+
such operating systems, an attacker could execute arbitrary commands with the
16+
privileges of the script.
17+
18+
Use of the c_rehash script is considered obsolete and should be replaced
19+
by the OpenSSL rehash command line tool.
20+
(CVE-2022-1292)
21+
[Tomáš Mráz]
22+
1023
Changes between 1.1.1m and 1.1.1n [15 Mar 2022]
1124

1225
*) Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever

deps/openssl/openssl/NEWS

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
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.1n and OpenSSL 1.1.1o [3 May 2022]
9+
10+
o Fixed a bug in the c_rehash script which was not properly sanitising
11+
shell metacharacters to prevent command injection (CVE-2022-1292)
12+
813
Major changes between OpenSSL 1.1.1m and OpenSSL 1.1.1n [15 Mar 2022]
914

1015
o Fixed a bug in the BN_mod_sqrt() function that can cause it to loop
11-
forever for non-prime moduli ([CVE-2022-0778])
16+
forever for non-prime moduli (CVE-2022-0778)
1217

1318
Major changes between OpenSSL 1.1.1l and OpenSSL 1.1.1m [14 Dec 2021]
1419

deps/openssl/openssl/README

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
OpenSSL 1.1.1n 15 Mar 2022
2+
OpenSSL 1.1.1o 3 May 2022
33

4-
Copyright (c) 1998-2021 The OpenSSL Project
4+
Copyright (c) 1998-2022 The OpenSSL Project
55
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
66
All rights reserved.
77

deps/openssl/openssl/apps/apps.c

+2
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
307307
if (cb_data != NULL && cb_data->password != NULL
308308
&& *(const char*)cb_data->password != '\0')
309309
pw_min_len = 1;
310+
else if (!verify)
311+
pw_min_len = 0;
310312
prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
311313
if (!prompt) {
312314
BIO_printf(bio_err, "Out of memory\n");

deps/openssl/openssl/apps/x509.c

+3-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-2022 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
@@ -590,6 +590,8 @@ int x509_main(int argc, char **argv)
590590
xca = load_cert(CAfile, CAformat, "CA Certificate");
591591
if (xca == NULL)
592592
goto end;
593+
if (!X509_set_issuer_name(x, X509_get_subject_name(xca)))
594+
goto end;
593595
}
594596

595597
out = bio_open_default(outfile, 'w', outformat);
@@ -987,8 +989,6 @@ static int x509_certify(X509_STORE *ctx, const char *CAfile, const EVP_MD *diges
987989
goto end;
988990
}
989991

990-
if (!X509_set_issuer_name(x, X509_get_subject_name(xca)))
991-
goto end;
992992
if (!X509_set_serialNumber(x, bs))
993993
goto end;
994994

deps/openssl/openssl/crypto/bn/bn_div.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2022 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
@@ -446,8 +446,10 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
446446
snum->neg = num_neg;
447447
snum->top = div_n;
448448
snum->flags |= BN_FLG_FIXED_TOP;
449-
if (rm != NULL)
450-
bn_rshift_fixed_top(rm, snum, norm_shift);
449+
450+
if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
451+
goto err;
452+
451453
BN_CTX_end(ctx);
452454
return 1;
453455
err:

deps/openssl/openssl/crypto/bn/bn_exp.c

+3-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-2022 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
@@ -188,13 +188,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
188188
return ret;
189189
}
190190

191+
BN_RECP_CTX_init(&recp);
192+
191193
BN_CTX_start(ctx);
192194
aa = BN_CTX_get(ctx);
193195
val[0] = BN_CTX_get(ctx);
194196
if (val[0] == NULL)
195197
goto err;
196198

197-
BN_RECP_CTX_init(&recp);
198199
if (m->neg) {
199200
/* ignore sign of 'm' */
200201
if (!BN_copy(aa, m))

deps/openssl/openssl/crypto/ec/curve448/curve448.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
33
* Copyright 2015-2016 Cryptography Research, Inc.
44
*
55
* Licensed under the OpenSSL license (the "License"). You may not use
@@ -577,6 +577,7 @@ static int recode_wnaf(struct smvt_control *control,
577577
int32_t delta = odd & mask;
578578

579579
assert(position >= 0);
580+
assert(pos < 32); /* can't fail since current & 0xFFFF != 0 */
580581
if (odd & (1 << (table_bits + 1)))
581582
delta -= (1 << (table_bits + 1));
582583
current -= delta * (1 << pos);

deps/openssl/openssl/crypto/ec/ecp_nistz256.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2014-2022 The OpenSSL Project Authors. All Rights Reserved.
33
* Copyright (c) 2014, Intel Corporation. All Rights Reserved.
44
* Copyright (c) 2015, CloudFlare, Inc.
55
*
@@ -973,6 +973,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group,
973973
return 0;
974974
}
975975

976+
memset(&p, 0, sizeof(p));
976977
BN_CTX_start(ctx);
977978

978979
if (scalar) {

deps/openssl/openssl/crypto/engine/eng_dyn.c

+22-11
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,26 @@ static int int_load(dynamic_data_ctx *ctx)
393393
return 0;
394394
}
395395

396+
/*
397+
* Unfortunately the version checker does not distinguish between
398+
* engines built for openssl 1.1.x and openssl 3.x, but loading
399+
* an engine that is built for openssl 3.x will cause a fatal
400+
* error. Detect such engines, since EVP_PKEY_get_base_id is exported
401+
* as a function in openssl 3.x, while it is named EVP_PKEY_base_id
402+
* in openssl 1.1.x. Therefore we take the presence of that symbol
403+
* as an indication that the engine will be incompatible.
404+
*/
405+
static int using_libcrypto_3(dynamic_data_ctx *ctx)
406+
{
407+
int ret;
408+
409+
ERR_set_mark();
410+
ret = DSO_bind_func(ctx->dynamic_dso, "EVP_PKEY_get_base_id") != NULL;
411+
ERR_pop_to_mark();
412+
413+
return ret;
414+
}
415+
396416
static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
397417
{
398418
ENGINE cpy;
@@ -442,18 +462,9 @@ static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
442462
/*
443463
* We fail if the version checker veto'd the load *or* if it is
444464
* deferring to us (by returning its version) and we think it is too
445-
* old.
446-
* Unfortunately the version checker does not distinguish between
447-
* engines built for openssl 1.1.x and openssl 3.x, but loading
448-
* an engine that is built for openssl 3.x will cause a fatal
449-
* error. Detect such engines, since EVP_PKEY_get_base_id is exported
450-
* as a function in openssl 3.x, while it is named EVP_PKEY_base_id
451-
* in openssl 1.1.x. Therefore we take the presence of that symbol
452-
* as an indication that the engine will be incompatible.
465+
* old. Also fail if this is engine for openssl 3.x.
453466
*/
454-
if (vcheck_res < OSSL_DYNAMIC_OLDEST
455-
|| DSO_bind_func(ctx->dynamic_dso,
456-
"EVP_PKEY_get_base_id") != NULL) {
467+
if (vcheck_res < OSSL_DYNAMIC_OLDEST || using_libcrypto_3(ctx)) {
457468
/* Fail */
458469
ctx->bind_engine = NULL;
459470
ctx->v_check = NULL;

0 commit comments

Comments
 (0)