14 Star 6 Fork 55

src-openEuler/edk2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0081-Fix-POLICYINFO-printing-to-not-assume-NUL-terminated.patch 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
ShenYage 提交于 2024-09-03 20:14 . Fix CVE-2021-3712、CVE-2022-0778
From 87e959f14e82b34fcb29bd11274b7039678639f1 Mon Sep 17 00:00:00 2001
From: Matt Caswell <[email protected]>
Date: Wed, 18 Aug 2021 12:31:38 +0100
Subject: [PATCH 2/9] Fix POLICYINFO printing to not assume NUL terminated
strings
ASN.1 strings may not be NUL terminated. Don't assume they are.
CVE-2021-3712
Reviewed-by: Viktor Dukhovni <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
---
.../Library/OpensslLib/openssl/crypto/x509v3/v3_cpols.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/x509v3/v3_cpols.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/x509v3/v3_cpols.c
index 1d12c89..861e845 100644
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/x509v3/v3_cpols.c
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/x509v3/v3_cpols.c
@@ -422,7 +422,8 @@ static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
qualinfo = sk_POLICYQUALINFO_value(quals, i);
switch (OBJ_obj2nid(qualinfo->pqualid)) {
case NID_id_qt_cps:
- BIO_printf(out, "%*sCPS: %s\n", indent, "",
+ BIO_printf(out, "%*sCPS: %.*s\n", indent, "",
+ qualinfo->d.cpsuri->length,
qualinfo->d.cpsuri->data);
break;
@@ -447,7 +448,8 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
if (notice->noticeref) {
NOTICEREF *ref;
ref = notice->noticeref;
- BIO_printf(out, "%*sOrganization: %s\n", indent, "",
+ BIO_printf(out, "%*sOrganization: %.*s\n", indent, "",
+ ref->organization->length,
ref->organization->data);
BIO_printf(out, "%*sNumber%s: ", indent, "",
sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : "");
@@ -470,7 +472,8 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
BIO_puts(out, "\n");
}
if (notice->exptext)
- BIO_printf(out, "%*sExplicit Text: %s\n", indent, "",
+ BIO_printf(out, "%*sExplicit Text: %.*s\n", indent, "",
+ notice->exptext->length,
notice->exptext->data);
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/edk2.git
[email protected]:src-openeuler/edk2.git
src-openeuler
edk2
edk2
openEuler-24.03-LTS-update-before-20241025

搜索帮助