代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libwd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 5927f19669247d738dfd4a687b5f134a2d289784 Mon Sep 17 00:00:00 2001
From: Kai Ye <yekai13@huawei.com>
Date: Wed, 29 Dec 2021 17:14:11 +0800
Subject: [PATCH 27/28] hisi-sec: bugfix for out_bytes checking
1. Add out_bytes checking for digest alg. and modify some log
information.
2. Optimize the in_bytes length checking.
Signed-off-by: Kai Ye <yekai13@huawei.com>
---
drv/hisi_sec.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drv/hisi_sec.c b/drv/hisi_sec.c
index 603bdda..d31a1b9 100644
--- a/drv/hisi_sec.c
+++ b/drv/hisi_sec.c
@@ -1279,9 +1279,9 @@ static void parse_digest_bd2(struct hisi_sec_sqe *sqe, struct wd_digest_msg *rec
static int digest_long_bd_check(struct wd_digest_msg *msg)
{
- if (msg->alg >= WD_DIGEST_SHA512 && msg->in_bytes % SHA512_ALIGN_SZ)
+ if (msg->alg >= WD_DIGEST_SHA512 && msg->in_bytes & (SHA512_ALIGN_SZ - 1))
return -WD_EINVAL;
- else if (msg->in_bytes % SHA1_ALIGN_SZ)
+ else if (msg->in_bytes & (SHA1_ALIGN_SZ - 1))
return -WD_EINVAL;
return 0;
@@ -1298,7 +1298,12 @@ static int digest_len_check(struct wd_digest_msg *msg, enum sec_bd_type type)
}
if (unlikely(msg->in_bytes > MAX_INPUT_DATA_LEN)) {
- WD_ERR("input data length is too long, size:%u!\n", msg->in_bytes);
+ WD_ERR("digest input length is too long, size:%u!\n", msg->in_bytes);
+ return -WD_EINVAL;
+ }
+
+ if (unlikely(msg->out_bytes & WORD_ALIGNMENT_MASK)) {
+ WD_ERR("digest out length is error, size:%u!\n", msg->out_bytes);
return -WD_EINVAL;
}
--
2.31.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。