Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
58dcbf4a
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
58dcbf4a
编写于
8月 02, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 02, 2023
浏览文件
操作
浏览文件
下载
差异文件
!128 fix-CVE-2023-3446-for-OpenHarmony-3.0-LTS
Merge pull request !128 from code4lala/fix-CVE-2023-3446-for-OpenHarmony-3.0-LTS
上级
5d68eb02
96f1baaa
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
44 addition
and
4 deletion
+44
-4
CHANGES
CHANGES
+16
-0
NEWS
NEWS
+1
-0
crypto/dh/dh_check.c
crypto/dh/dh_check.c
+6
-0
crypto/dh/dh_err.c
crypto/dh/dh_err.c
+2
-1
crypto/err/openssl.txt
crypto/err/openssl.txt
+1
-0
include/openssl/dh.h
include/openssl/dh.h
+3
-0
include/openssl/dherr.h
include/openssl/dherr.h
+2
-1
test/dhtest.c
test/dhtest.c
+13
-2
未找到文件。
CHANGES
浏览文件 @
58dcbf4a
...
...
@@ -6,6 +6,22 @@
For a full list of changes, see the git commit log; for example,
https://github.com/openssl/openssl/commits/ and pick the appropriate
release branch.
*) Fix DH_check() excessive time with over sized modulus
The function DH_check() performs various checks on DH parameters. One of
those checks confirms that the modulus ("p" parameter) is not too large.
Trying to use a very large modulus is slow and OpenSSL will not normally use
a modulus which is over 10,000 bits in length.
However the DH_check() function checks numerous aspects of the key or
parameters that have been supplied. Some of those checks use the supplied
modulus value even if it has already been found to be too large.
A new limit has been added to DH_check of 32,768 bits. Supplying a
key/parameters with a modulus over this size will simply cause DH_check()
to fail.
(CVE-2023-3446)
[Matt Caswell]
*) Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.
...
...
NEWS
浏览文件 @
58dcbf4a
...
...
@@ -4,6 +4,7 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
o Fix DH_check() excessive time with over sized modulus (CVE-2023-3446)
o Fixed documentation of X509_VERIFY_PARAM_add0_policy() (CVE-2023-0466)
o Mitigate for very slow `OBJ_obj2txt()` performance with gigantic
OBJECT IDENTIFIER sub-identities. (CVE-2023-2650)
...
...
crypto/dh/dh_check.c
浏览文件 @
58dcbf4a
...
...
@@ -101,6 +101,12 @@ int DH_check(const DH *dh, int *ret)
BN_CTX
*
ctx
=
NULL
;
BIGNUM
*
t1
=
NULL
,
*
t2
=
NULL
;
/* Don't do any checks at all with an excessively large modulus */
if
(
BN_num_bits
(
dh
->
p
)
>
OPENSSL_DH_CHECK_MAX_MODULUS_BITS
)
{
DHerr
(
DH_F_DH_CHECK
,
DH_R_MODULUS_TOO_LARGE
);
return
0
;
}
if
(
!
DH_check_params
(
dh
,
ret
))
return
0
;
...
...
crypto/dh/dh_err.c
浏览文件 @
58dcbf4a
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-20
18
The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-20
23
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
...
...
@@ -18,6 +18,7 @@ static const ERR_STRING_DATA DH_str_functs[] = {
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DHPARAMS_PRINT_FP
,
0
),
"DHparams_print_fp"
},
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DH_BUILTIN_GENPARAMS
,
0
),
"dh_builtin_genparams"
},
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DH_CHECK
,
0
),
"DH_check"
},
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DH_CHECK_EX
,
0
),
"DH_check_ex"
},
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DH_CHECK_PARAMS_EX
,
0
),
"DH_check_params_ex"
},
{
ERR_PACK
(
ERR_LIB_DH
,
DH_F_DH_CHECK_PUB_KEY_EX
,
0
),
"DH_check_pub_key_ex"
},
...
...
crypto/err/openssl.txt
浏览文件 @
58dcbf4a
...
...
@@ -402,6 +402,7 @@ CT_F_SCT_SET_VERSION:104:SCT_set_version
DH_F_COMPUTE_KEY:102:compute_key
DH_F_DHPARAMS_PRINT_FP:101:DHparams_print_fp
DH_F_DH_BUILTIN_GENPARAMS:106:dh_builtin_genparams
DH_F_DH_CHECK:126:DH_check
DH_F_DH_CHECK_EX:121:DH_check_ex
DH_F_DH_CHECK_PARAMS_EX:122:DH_check_params_ex
DH_F_DH_CHECK_PUB_KEY_EX:123:DH_check_pub_key_ex
...
...
include/openssl/dh.h
浏览文件 @
58dcbf4a
...
...
@@ -29,6 +29,9 @@ extern "C" {
# ifndef OPENSSL_DH_MAX_MODULUS_BITS
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
# endif
# ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS
# define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768
# endif
# define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
...
...
include/openssl/dherr.h
浏览文件 @
58dcbf4a
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-20
19
The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-20
23
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
...
...
@@ -30,6 +30,7 @@ int ERR_load_DH_strings(void);
# define DH_F_COMPUTE_KEY 102
# define DH_F_DHPARAMS_PRINT_FP 101
# define DH_F_DH_BUILTIN_GENPARAMS 106
# define DH_F_DH_CHECK 126
# define DH_F_DH_CHECK_EX 121
# define DH_F_DH_CHECK_PARAMS_EX 122
# define DH_F_DH_CHECK_PUB_KEY_EX 123
...
...
test/dhtest.c
浏览文件 @
58dcbf4a
...
...
@@ -63,7 +63,7 @@ static int dh_test(void)
||
!
TEST_true
(
DH_set0_pqg
(
dh
,
p
,
q
,
g
)))
goto
err1
;
if
(
!
DH_check
(
dh
,
&
i
))
if
(
!
TEST_true
(
DH_check
(
dh
,
&
i
)
))
goto
err2
;
if
(
!
TEST_false
(
i
&
DH_CHECK_P_NOT_PRIME
)
||
!
TEST_false
(
i
&
DH_CHECK_P_NOT_SAFE_PRIME
)
...
...
@@ -123,6 +123,17 @@ static int dh_test(void)
/* check whether the public key was calculated correctly */
TEST_uint_eq
(
BN_get_word
(
pub_key2
),
3331L
);
/* Modulus of size: dh check max modulus bits + 1 */
if
(
!
TEST_true
(
BN_set_word
(
p
,
1
))
||
!
TEST_true
(
BN_lshift
(
p
,
p
,
OPENSSL_DH_CHECK_MAX_MODULUS_BITS
)))
goto
err3
;
/*
* We expect no checks at all for an excessively large modulus
*/
if
(
!
TEST_false
(
DH_check
(
dh
,
&
i
)))
goto
err3
;
/*
* II) key generation
*/
...
...
@@ -137,7 +148,7 @@ static int dh_test(void)
goto
err3
;
/* ... and check whether it is valid */
if
(
!
DH_check
(
a
,
&
i
))
if
(
!
TEST_true
(
DH_check
(
a
,
&
i
)
))
goto
err3
;
if
(
!
TEST_false
(
i
&
DH_CHECK_P_NOT_PRIME
)
||
!
TEST_false
(
i
&
DH_CHECK_P_NOT_SAFE_PRIME
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录