代码拉取完成,页面将自动刷新
From b3243a754763f6df19351593781b88e277a324bc Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Sun, 23 May 2021 18:28:57 +0200
Subject: [PATCH] rpc-server: Disable parsing CKF_ARRAY_ATTRIBUTE
This is a temporary measure to avoid oss-fuzz failure. When the
attribute array is nested, the current internal API cannot determine
the actual size of data that need to be stored, because ulValueLen is
set to the attribute count times sizeof(CK_ATTRIBUTE).
Signed-off-by: Daiki Ueno <ueno@gnu.org>
---
p11-kit/rpc-client.c | 5 +++++
p11-kit/rpc-server.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/p11-kit/rpc-client.c b/p11-kit/rpc-client.c
index 6e9cd60..ae66375 100644
--- a/p11-kit/rpc-client.c
+++ b/p11-kit/rpc-client.c
@@ -241,6 +241,11 @@ proto_read_attribute_array (p11_rpc_message *msg,
return PARSE_ERROR;
}
+ if (temp.type & CKF_ARRAY_ATTRIBUTE) {
+ p11_debug("recursive attribute array is not supported");
+ return PARSE_ERROR;
+ }
+
/* Try and stuff it in the output data */
if (arr) {
CK_ATTRIBUTE *attr = &(arr[i]);
diff --git a/p11-kit/rpc-server.c b/p11-kit/rpc-server.c
index 796a674..ba7240e 100644
--- a/p11-kit/rpc-server.c
+++ b/p11-kit/rpc-server.c
@@ -323,6 +323,11 @@ proto_read_attribute_array (p11_rpc_message *msg,
return PARSE_ERROR;
}
+ if (temp.type & CKF_ARRAY_ATTRIBUTE) {
+ p11_debug("recursive attribute array is not supported");
+ return PARSE_ERROR;
+ }
+
attrs[i].type = temp.type;
/* Whether this one is valid or not */
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。