Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
d3cc91ee
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
d3cc91ee
编写于
7月 20, 2013
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enhance DH dup functions.
Make DHparams_dup work properly with X9.42 DH parameters.
上级
c9577ab5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
22 deletion
+60
-22
crypto/dh/dh_ameth.c
crypto/dh/dh_ameth.c
+60
-17
crypto/dh/dh_asn1.c
crypto/dh/dh_asn1.c
+0
-5
未找到文件。
crypto/dh/dh_ameth.c
浏览文件 @
d3cc91ee
...
...
@@ -458,34 +458,77 @@ static int dh_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
return
1
;
}
static
int
dh_copy_parameters
(
EVP_PKEY
*
to
,
const
EVP_PKEY
*
from
)
static
int
int_dh_bn_cpy
(
BIGNUM
**
dst
,
const
BIGNUM
*
src
)
{
BIGNUM
*
a
;
if
(
src
)
{
a
=
BN_dup
(
src
);
if
(
!
a
)
return
0
;
}
else
a
=
NULL
;
if
(
*
dst
)
BN_free
(
*
dst
);
*
dst
=
a
;
return
1
;
}
if
((
a
=
BN_dup
(
from
->
pkey
.
dh
->
p
))
==
NULL
)
static
int
int_dh_param_copy
(
DH
*
to
,
const
DH
*
from
,
int
is_x942
)
{
if
(
is_x942
==
-
1
)
is_x942
=
!!
from
->
q
;
if
(
!
int_dh_bn_cpy
(
&
to
->
p
,
from
->
p
))
return
0
;
if
(
to
->
pkey
.
dh
->
p
!=
NULL
)
BN_free
(
to
->
pkey
.
dh
->
p
);
to
->
pkey
.
dh
->
p
=
a
;
if
((
a
=
BN_dup
(
from
->
pkey
.
dh
->
g
))
==
NULL
)
if
(
!
int_dh_bn_cpy
(
&
to
->
g
,
from
->
g
))
return
0
;
if
(
to
->
pkey
.
dh
->
g
!=
NULL
)
BN_free
(
to
->
pkey
.
dh
->
g
);
to
->
pkey
.
dh
->
g
=
a
;
if
(
from
->
ameth
==
&
dhx_asn1_meth
)
if
(
is_x942
)
{
a
=
BN_dup
(
from
->
pkey
.
dh
->
q
);
if
(
!
a
)
if
(
!
int_dh_bn_cpy
(
&
to
->
q
,
from
->
q
))
return
0
;
if
(
!
int_dh_bn_cpy
(
&
to
->
j
,
from
->
j
))
return
0
;
if
(
to
->
pkey
.
dh
->
q
)
BN_free
(
to
->
pkey
.
dh
->
q
);
to
->
pkey
.
dh
->
q
=
a
;
if
(
to
->
seed
)
{
OPENSSL_free
(
to
->
seed
);
to
->
seed
=
NULL
;
to
->
seedlen
=
0
;
}
if
(
from
->
seed
)
{
to
->
seed
=
BUF_memdup
(
from
->
seed
,
from
->
seedlen
);
if
(
!
to
->
seed
)
return
0
;
to
->
seedlen
=
from
->
seedlen
;
}
}
else
to
->
length
=
from
->
length
;
return
1
;
}
DH
*
DHparams_dup
(
DH
*
dh
)
{
DH
*
ret
;
ret
=
DH_new
();
if
(
!
ret
)
return
NULL
;
if
(
!
int_dh_param_copy
(
ret
,
dh
,
-
1
))
{
DH_free
(
ret
);
return
NULL
;
}
return
ret
;
}
static
int
dh_copy_parameters
(
EVP_PKEY
*
to
,
const
EVP_PKEY
*
from
)
{
return
int_dh_param_copy
(
to
->
pkey
.
dh
,
from
->
pkey
.
dh
,
from
->
ameth
==
&
dhx_asn1_meth
);
}
static
int
dh_missing_parameters
(
const
EVP_PKEY
*
a
)
{
if
(
!
a
->
pkey
.
dh
->
p
||
!
a
->
pkey
.
dh
->
g
)
...
...
crypto/dh/dh_asn1.c
浏览文件 @
d3cc91ee
...
...
@@ -87,11 +87,6 @@ ASN1_SEQUENCE_cb(DHparams, dh_cb) = {
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname
(
DH
,
DHparams
,
DHparams
)
DH
*
DHparams_dup
(
DH
*
dh
)
{
return
ASN1_item_dup
(
ASN1_ITEM_rptr
(
DHparams
),
dh
);
}
/* Internal only structures for handling X9.42 DH: this gets translated
* to or from a DH structure straight away.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录