1 Star 0 Fork 43

linwei9/gnutls

forked from src-openEuler/gnutls 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-do-not-go-try-calculating-pdkdf2-with-0-iterations.patch 993 Bytes
一键复制 编辑 原始数据 按行查看 历史
anakinzhang 提交于 2020-06-08 10:59 +08:00 . fix x509 endless drop and pkcs12 iterations
From 495aa9b57a3ce3ee546a0498ef232b4aa47d0f51 Mon Sep 17 00:00:00 2001
From: Dmitry Baryshkov <dbaryshkov@gmail.com>
Date: Tue, 28 Jan 2020 13:05:14 +0300
Subject: [PATCH] pkcs12: do not go try calculating pbkdf2 with 0 iterations
Nettle will abort on a call to pbkdf2 if iterations is 0. Add check to
GnuTLS PKCS12 GOST code to check that iter is not 0.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
---
.../dcbb6c7d385ddf87823849890768b022dc9e1eff | Bin 0 -> 1011 bytes
lib/x509/pkcs12.c | 3 +++
2 files changed, 3 insertions(+)
diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c
index 8c3310d066..6324fb25a3 100644
--- a/lib/x509/pkcs12.c
+++ b/lib/x509/pkcs12.c
@@ -867,6 +867,9 @@ _gnutls_pkcs12_gost_string_to_key(gnutls_mac_algorithm_t algo,
size_t temp_len = sizeof(temp);
unsigned int pass_len = 0;
+ if (iter == 0)
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+
if (pass)
pass_len = strlen(pass);
--
2.26.2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linwei9/gnutls.git
git@gitee.com:linwei9/gnutls.git
linwei9
gnutls
gnutls
master

搜索帮助