Skip to content

Commit 392d455

Browse files
committed
1.1.1t
1 parent 4d10978 commit 392d455

Some content is hidden

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

48 files changed

+1546
-339
lines changed

CHANGES

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,85 @@
77
https://github.com/openssl/openssl/commits/ and pick the appropriate
88
release branch.
99

10+
Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
11+
12+
*) Fixed X.400 address type confusion in X.509 GeneralName.
13+
14+
There is a type confusion vulnerability relating to X.400 address processing
15+
inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
16+
but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
17+
vulnerability may allow an attacker who can provide a certificate chain and
18+
CRL (neither of which need have a valid signature) to pass arbitrary
19+
pointers to a memcmp call, creating a possible read primitive, subject to
20+
some constraints. Refer to the advisory for more information. Thanks to
21+
David Benjamin for discovering this issue. (CVE-2023-0286)
22+
23+
This issue has been fixed by changing the public header file definition of
24+
GENERAL_NAME so that x400Address reflects the implementation. It was not
25+
possible for any existing application to successfully use the existing
26+
definition; however, if any application references the x400Address field
27+
(e.g. in dead code), note that the type of this field has changed. There is
28+
no ABI change.
29+
[Hugo Landau]
30+
31+
*) Fixed Use-after-free following BIO_new_NDEF.
32+
33+
The public API function BIO_new_NDEF is a helper function used for
34+
streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
35+
to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
36+
be called directly by end user applications.
37+
38+
The function receives a BIO from the caller, prepends a new BIO_f_asn1
39+
filter BIO onto the front of it to form a BIO chain, and then returns
40+
the new head of the BIO chain to the caller. Under certain conditions,
41+
for example if a CMS recipient public key is invalid, the new filter BIO
42+
is freed and the function returns a NULL result indicating a failure.
43+
However, in this case, the BIO chain is not properly cleaned up and the
44+
BIO passed by the caller still retains internal pointers to the previously
45+
freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
46+
then a use-after-free will occur. This will most likely result in a crash.
47+
(CVE-2023-0215)
48+
[Viktor Dukhovni, Matt Caswell]
49+
50+
*) Fixed Double free after calling PEM_read_bio_ex.
51+
52+
The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
53+
decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
54+
data. If the function succeeds then the "name_out", "header" and "data"
55+
arguments are populated with pointers to buffers containing the relevant
56+
decoded data. The caller is responsible for freeing those buffers. It is
57+
possible to construct a PEM file that results in 0 bytes of payload data.
58+
In this case PEM_read_bio_ex() will return a failure code but will populate
59+
the header argument with a pointer to a buffer that has already been freed.
60+
If the caller also frees this buffer then a double free will occur. This
61+
will most likely lead to a crash.
62+
63+
The functions PEM_read_bio() and PEM_read() are simple wrappers around
64+
PEM_read_bio_ex() and therefore these functions are also directly affected.
65+
66+
These functions are also called indirectly by a number of other OpenSSL
67+
functions including PEM_X509_INFO_read_bio_ex() and
68+
SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
69+
internal uses of these functions are not vulnerable because the caller does
70+
not free the header argument if PEM_read_bio_ex() returns a failure code.
71+
(CVE-2022-4450)
72+
[Kurt Roeckx, Matt Caswell]
73+
74+
*) Fixed Timing Oracle in RSA Decryption.
75+
76+
A timing based side channel exists in the OpenSSL RSA Decryption
77+
implementation which could be sufficient to recover a plaintext across
78+
a network in a Bleichenbacher style attack. To achieve a successful
79+
decryption an attacker would have to be able to send a very large number
80+
of trial messages for decryption. The vulnerability affects all RSA padding
81+
modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
82+
(CVE-2022-4304)
83+
[Dmitry Belyavsky, Hubert Kario]
84+
1085
Changes between 1.1.1r and 1.1.1s [1 Nov 2022]
1186

1287
*) Fixed a regression introduced in 1.1.1r version not refreshing the
1388
certificate data to be signed before signing the certificate.
14-
1589
[Gibeom Gwon]
1690

1791
Changes between 1.1.1q and 1.1.1r [11 Oct 2022]

Configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env perl
22
# -*- mode: perl; -*-
3-
# Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
3+
# Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
44
#
55
# Licensed under the OpenSSL license (the "License"). You may not use
66
# this file except in compliance with the License. You can obtain a copy
@@ -1215,7 +1215,7 @@ $target{build_scheme} = [ $target{build_scheme} ]
12151215
my ($builder, $builder_platform, @builder_opts) =
12161216
@{$target{build_scheme}};
12171217

1218-
foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm",
1218+
foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm",
12191219
$builder_platform."-checker.pm")) {
12201220
my $checker_path = catfile($srcdir, "Configurations", $checker);
12211221
if (-f $checker_path) {
@@ -1712,8 +1712,8 @@ if ($builder eq "unified") {
17121712
# Store the name of the template file we will build the build file from
17131713
# in %config. This may be useful for the build file itself.
17141714
my @build_file_template_names =
1715-
( $builder_platform."-".$target{build_file}.".tmpl",
1716-
$target{build_file}.".tmpl" );
1715+
( $builder_platform."-".$config{build_file}.".tmpl",
1716+
$config{build_file}.".tmpl" );
17171717
my @build_file_templates = ();
17181718

17191719
# First, look in the user provided directory, if given
@@ -1937,8 +1937,8 @@ if ($builder eq "unified") {
19371937
}
19381938
next if @skip && $skip[$#skip] <= 0;
19391939
push @rawlines, $_
1940-
if ($target_kind eq $target{build_file}
1941-
|| $target_kind eq $target{build_file}."(".$builder_platform.")");
1940+
if ($target_kind eq $config{build_file}
1941+
|| $target_kind eq $config{build_file}."(".$builder_platform.")");
19421942
}
19431943
},
19441944
qr/^\s*(?:#.*)?$/ => sub { },
@@ -2813,8 +2813,8 @@ if ($builder_platform eq 'unix') {
28132813

28142814
my %builders = (
28152815
unified => sub {
2816-
print 'Creating ',$target{build_file},"\n";
2817-
run_dofile(catfile($blddir, $target{build_file}),
2816+
print 'Creating ',$config{build_file},"\n";
2817+
run_dofile(catfile($blddir, $config{build_file}),
28182818
@{$config{build_file_templates}});
28192819
},
28202820
);
@@ -2868,7 +2868,7 @@ exit(0);
28682868
#
28692869
sub death_handler {
28702870
die @_ if $^S; # To prevent the added message in eval blocks
2871-
my $build_file = $target{build_file} // "build file";
2871+
my $build_file = $config{build_file} // "build file";
28722872
my @message = ( <<"_____", @_ );
28732873
28742874
Failure! $build_file wasn't produced.

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
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.1s and OpenSSL 1.1.1t [7 Feb 2023]
9+
10+
o Fixed X.400 address type confusion in X.509 GeneralName (CVE-2023-0286)
11+
o Fixed Use-after-free following BIO_new_NDEF (CVE-2023-0215)
12+
o Fixed Double free after calling PEM_read_bio_ex (CVE-2022-4450)
13+
o Fixed Timing Oracle in RSA Decryption (CVE-2022-4304)
14+
815
Major changes between OpenSSL 1.1.1r and OpenSSL 1.1.1s [1 Nov 2022]
916

1017
o Fixed a regression introduced in OpenSSL 1.1.1r not refreshing the

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OpenSSL 1.1.1s 1 Nov 2022
2+
OpenSSL 1.1.1t 7 Feb 2023
33

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

crypto/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ add_submodule ( blake2 blake2b.c blake2s.c m_blake2b.c m_blake2s.c )
119119
add_submodule ( bn bn_add.c bn_asm.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_dh.c
120120
bn_div.c bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_intern.c bn_kron.c bn_lib.c
121121
bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c bn_recp.c
122-
bn_shift.c bn_sqr.c bn_sqrt.c bn_srp.c bn_word.c bn_x931p.c rsaz_exp.c )
122+
bn_shift.c bn_sqr.c bn_sqrt.c bn_srp.c bn_word.c bn_x931p.c rsaz_exp.c rsa_sup_mul.c )
123123

124124
add_submodule ( buffer buf_err.c buffer.c )
125125

crypto/asn1/asn_mime.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
489489
char eol;
490490
int len;
491491
char linebuf[MAX_SMLEN];
492+
int ret;
492493
/*
493494
* Buffer output so we don't write one line at a time. This is useful
494495
* when streaming as we don't end up with one OCTET STRING per line.
@@ -523,9 +524,12 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags)
523524
BIO_write(out, "\r\n", 2);
524525
}
525526
}
526-
(void)BIO_flush(out);
527+
ret = BIO_flush(out);
527528
BIO_pop(out);
528529
BIO_free(bf);
530+
if (ret <= 0)
531+
return 0;
532+
529533
return 1;
530534
}
531535

crypto/asn1/bio_asn1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl)
172172
case ASN1_STATE_START:
173173
if (!asn1_bio_setup_ex(b, ctx, ctx->prefix,
174174
ASN1_STATE_PRE_COPY, ASN1_STATE_HEADER))
175-
return 0;
175+
return -1;
176176
break;
177177

178178
/* Copy any pre data first */
@@ -189,7 +189,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl)
189189
case ASN1_STATE_HEADER:
190190
ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl;
191191
if (!ossl_assert(ctx->buflen <= ctx->bufsize))
192-
return 0;
192+
return -1;
193193
p = ctx->buf;
194194
ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class);
195195
ctx->copylen = inl;

crypto/asn1/bio_ndef.c

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2008-2023 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
@@ -49,12 +49,19 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg);
4949
static int ndef_suffix_free(BIO *b, unsigned char **pbuf, int *plen,
5050
void *parg);
5151

52+
/*
53+
* On success, the returned BIO owns the input BIO as part of its BIO chain.
54+
* On failure, NULL is returned and the input BIO is owned by the caller.
55+
*
56+
* Unfortunately cannot constify this due to CMS_stream() and PKCS7_stream()
57+
*/
5258
BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
5359
{
5460
NDEF_SUPPORT *ndef_aux = NULL;
5561
BIO *asn_bio = NULL;
5662
const ASN1_AUX *aux = it->funcs;
5763
ASN1_STREAM_ARG sarg;
64+
BIO *pop_bio = NULL;
5865

5966
if (!aux || !aux->asn1_cb) {
6067
ASN1err(ASN1_F_BIO_NEW_NDEF, ASN1_R_STREAMING_NOT_SUPPORTED);
@@ -69,33 +76,51 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it)
6976
out = BIO_push(asn_bio, out);
7077
if (out == NULL)
7178
goto err;
79+
pop_bio = asn_bio;
7280

73-
BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free);
74-
BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free);
81+
if (BIO_asn1_set_prefix(asn_bio, ndef_prefix, ndef_prefix_free) <= 0
82+
|| BIO_asn1_set_suffix(asn_bio, ndef_suffix, ndef_suffix_free) <= 0
83+
|| BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux) <= 0)
84+
goto err;
7585

7686
/*
77-
* Now let callback prepends any digest, cipher etc BIOs ASN1 structure
78-
* needs.
87+
* Now let the callback prepend any digest, cipher, etc., that the BIO's
88+
* ASN1 structure needs.
7989
*/
8090

8191
sarg.out = out;
8292
sarg.ndef_bio = NULL;
8393
sarg.boundary = NULL;
8494

85-
if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0)
95+
/*
96+
* The asn1_cb(), must not have mutated asn_bio on error, leaving it in the
97+
* middle of some partially built, but not returned BIO chain.
98+
*/
99+
if (aux->asn1_cb(ASN1_OP_STREAM_PRE, &val, it, &sarg) <= 0) {
100+
/*
101+
* ndef_aux is now owned by asn_bio so we must not free it in the err
102+
* clean up block
103+
*/
104+
ndef_aux = NULL;
86105
goto err;
106+
}
107+
108+
/*
109+
* We must not fail now because the callback has prepended additional
110+
* BIOs to the chain
111+
*/
87112

88113
ndef_aux->val = val;
89114
ndef_aux->it = it;
90115
ndef_aux->ndef_bio = sarg.ndef_bio;
91116
ndef_aux->boundary = sarg.boundary;
92117
ndef_aux->out = out;
93118

94-
BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux);
95-
96119
return sarg.ndef_bio;
97120

98121
err:
122+
/* BIO_pop() is NULL safe */
123+
(void)BIO_pop(pop_bio);
99124
BIO_free(asn_bio);
100125
OPENSSL_free(ndef_aux);
101126
return NULL;

crypto/bio/b_print.c

Lines changed: 21 additions & 1 deletion
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-2023 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
@@ -13,6 +13,7 @@
1313
#include "crypto/ctype.h"
1414
#include "internal/numbers.h"
1515
#include <openssl/bio.h>
16+
#include <openssl/opensslconf.h>
1617

1718
/*
1819
* Copyright Patrick Powell 1995
@@ -31,8 +32,10 @@ static int fmtstr(char **, char **, size_t *, size_t *,
3132
const char *, int, int, int);
3233
static int fmtint(char **, char **, size_t *, size_t *,
3334
int64_t, int, int, int, int);
35+
#ifndef OPENSSL_SYS_UEFI
3436
static int fmtfp(char **, char **, size_t *, size_t *,
3537
LDOUBLE, int, int, int, int);
38+
#endif
3639
static int doapr_outch(char **, char **, size_t *, size_t *, int);
3740
static int _dopr(char **sbuffer, char **buffer,
3841
size_t *maxlen, size_t *retlen, int *truncated,
@@ -88,7 +91,9 @@ _dopr(char **sbuffer,
8891
{
8992
char ch;
9093
int64_t value;
94+
#ifndef OPENSSL_SYS_UEFI
9195
LDOUBLE fvalue;
96+
#endif
9297
char *strvalue;
9398
int min;
9499
int max;
@@ -259,6 +264,7 @@ _dopr(char **sbuffer,
259264
min, max, flags))
260265
return 0;
261266
break;
267+
#ifndef OPENSSL_SYS_UEFI
262268
case 'f':
263269
if (cflags == DP_C_LDOUBLE)
264270
fvalue = va_arg(args, LDOUBLE);
@@ -292,6 +298,16 @@ _dopr(char **sbuffer,
292298
flags, G_FORMAT))
293299
return 0;
294300
break;
301+
#else
302+
case 'f':
303+
case 'E':
304+
case 'e':
305+
case 'G':
306+
case 'g':
307+
/* not implemented for UEFI */
308+
ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
309+
return 0;
310+
#endif
295311
case 'c':
296312
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
297313
va_arg(args, int)))
@@ -512,6 +528,8 @@ fmtint(char **sbuffer,
512528
return 1;
513529
}
514530

531+
#ifndef OPENSSL_SYS_UEFI
532+
515533
static LDOUBLE abs_val(LDOUBLE value)
516534
{
517535
LDOUBLE result = value;
@@ -803,6 +821,8 @@ fmtfp(char **sbuffer,
803821
return 1;
804822
}
805823

824+
#endif /* OPENSSL_SYS_UEFI */
825+
806826
#define BUFFER_INC 1024
807827

808828
static int

0 commit comments

Comments
 (0)