summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch
new file mode 100644
index 0000000000..be5068074e
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/CVE-2023-0465.patch
@@ -0,0 +1,60 @@
1From b013765abfa80036dc779dd0e50602c57bb3bf95 Mon Sep 17 00:00:00 2001
2From: Matt Caswell <matt@openssl.org>
3Date: Tue, 7 Mar 2023 16:52:55 +0000
4Subject: [PATCH] Ensure that EXFLAG_INVALID_POLICY is checked even in leaf
5 certs
6
7Even though we check the leaf cert to confirm it is valid, we
8later ignored the invalid flag and did not notice that the leaf
9cert was bad.
10
11Fixes: CVE-2023-0465
12
13Reviewed-by: Hugo Landau <hlandau@openssl.org>
14Reviewed-by: Tomas Mraz <tomas@openssl.org>
15(Merged from https://github.com/openssl/openssl/pull/20588)
16
17CVE: CVE-2023-0465
18Upstream-Status: Backport [https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=b013765abfa80036dc779dd0e50602c57bb3bf95]
19Comment: Refreshed first hunk
20Signed-off-by: Omkar Patil <omkar.patil@kpit.com>
21
22---
23 crypto/x509/x509_vfy.c | 11 +++++++++--
24 1 file changed, 9 insertions(+), 2 deletions(-)
25
26diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
27index 925fbb5412..1dfe4f9f31 100644
28--- a/crypto/x509/x509_vfy.c
29+++ b/crypto/x509/x509_vfy.c
30@@ -1649,18 +1649,25 @@
31 }
32 /* Invalid or inconsistent extensions */
33 if (ret == X509_PCY_TREE_INVALID) {
34- int i;
35+ int i, cbcalled = 0;
36
37 /* Locate certificates with bad extensions and notify callback. */
38- for (i = 1; i < sk_X509_num(ctx->chain); i++) {
39+ for (i = 0; i < sk_X509_num(ctx->chain); i++) {
40 X509 *x = sk_X509_value(ctx->chain, i);
41
42 if (!(x->ex_flags & EXFLAG_INVALID_POLICY))
43 continue;
44+ cbcalled = 1;
45 if (!verify_cb_cert(ctx, x, i,
46 X509_V_ERR_INVALID_POLICY_EXTENSION))
47 return 0;
48 }
49+ if (!cbcalled) {
50+ /* Should not be able to get here */
51+ X509err(X509_F_CHECK_POLICY, ERR_R_INTERNAL_ERROR);
52+ return 0;
53+ }
54+ /* The callback ignored the error so we return success */
55 return 1;
56 }
57 if (ret == X509_PCY_TREE_FAILURE) {
58--
592.34.1
60