Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
f11d0c79
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
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看板
提交
f11d0c79
编写于
10月 05, 2012
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix EC_KEY initialization race.
Submitted by: Adam Langley
上级
323fa645
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
38 addition
and
7 deletion
+38
-7
crypto/ec/ec.h
crypto/ec/ec.h
+9
-1
crypto/ec/ec_key.c
crypto/ec/ec_key.c
+11
-2
crypto/ecdh/ech_lib.c
crypto/ecdh/ech_lib.c
+9
-2
crypto/ecdsa/ecs_lib.c
crypto/ecdsa/ecs_lib.c
+9
-2
未找到文件。
crypto/ec/ec.h
浏览文件 @
f11d0c79
...
@@ -810,7 +810,15 @@ void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
...
@@ -810,7 +810,15 @@ void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
/* functions to set/get method specific data */
/* functions to set/get method specific data */
void
*
EC_KEY_get_key_method_data
(
EC_KEY
*
key
,
void
*
EC_KEY_get_key_method_data
(
EC_KEY
*
key
,
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
));
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
));
void
EC_KEY_insert_key_method_data
(
EC_KEY
*
key
,
void
*
data
,
/** Sets the key method data of an EC_KEY object, if none has yet been set.
* \param key EC_KEY object
* \param data opaque data to install.
* \param dup_func a function that duplicates |data|.
* \param free_func a function that frees |data|.
* \param clear_free_func a function that wipes and frees |data|.
* \return the previously set data pointer, or NULL if |data| was inserted.
*/
void
*
EC_KEY_insert_key_method_data
(
EC_KEY
*
key
,
void
*
data
,
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
));
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
));
/* wrapper functions for the underlying EC_GROUP object */
/* wrapper functions for the underlying EC_GROUP object */
void
EC_KEY_set_asn1_flag
(
EC_KEY
*
eckey
,
int
asn1_flag
);
void
EC_KEY_set_asn1_flag
(
EC_KEY
*
eckey
,
int
asn1_flag
);
...
...
crypto/ec/ec_key.c
浏览文件 @
f11d0c79
...
@@ -604,18 +604,27 @@ void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform)
...
@@ -604,18 +604,27 @@ void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform)
void
*
EC_KEY_get_key_method_data
(
EC_KEY
*
key
,
void
*
EC_KEY_get_key_method_data
(
EC_KEY
*
key
,
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
))
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
))
{
{
return
EC_EX_DATA_get_data
(
key
->
method_data
,
dup_func
,
free_func
,
clear_free_func
);
void
*
ret
;
CRYPTO_r_lock
(
CRYPTO_LOCK_EC
);
ret
=
EC_EX_DATA_get_data
(
key
->
method_data
,
dup_func
,
free_func
,
clear_free_func
);
CRYPTO_r_unlock
(
CRYPTO_LOCK_EC
);
return
ret
;
}
}
void
EC_KEY_insert_key_method_data
(
EC_KEY
*
key
,
void
*
data
,
void
*
EC_KEY_insert_key_method_data
(
EC_KEY
*
key
,
void
*
data
,
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
))
void
*
(
*
dup_func
)(
void
*
),
void
(
*
free_func
)(
void
*
),
void
(
*
clear_free_func
)(
void
*
))
{
{
EC_EXTRA_DATA
*
ex_data
;
EC_EXTRA_DATA
*
ex_data
;
CRYPTO_w_lock
(
CRYPTO_LOCK_EC
);
CRYPTO_w_lock
(
CRYPTO_LOCK_EC
);
ex_data
=
EC_EX_DATA_get_data
(
key
->
method_data
,
dup_func
,
free_func
,
clear_free_func
);
ex_data
=
EC_EX_DATA_get_data
(
key
->
method_data
,
dup_func
,
free_func
,
clear_free_func
);
if
(
ex_data
==
NULL
)
if
(
ex_data
==
NULL
)
EC_EX_DATA_set_data
(
&
key
->
method_data
,
data
,
dup_func
,
free_func
,
clear_free_func
);
EC_EX_DATA_set_data
(
&
key
->
method_data
,
data
,
dup_func
,
free_func
,
clear_free_func
);
CRYPTO_w_unlock
(
CRYPTO_LOCK_EC
);
CRYPTO_w_unlock
(
CRYPTO_LOCK_EC
);
return
ex_data
;
}
}
void
EC_KEY_set_asn1_flag
(
EC_KEY
*
key
,
int
flag
)
void
EC_KEY_set_asn1_flag
(
EC_KEY
*
key
,
int
flag
)
...
...
crypto/ecdh/ech_lib.c
浏览文件 @
f11d0c79
...
@@ -210,8 +210,15 @@ ECDH_DATA *ecdh_check(EC_KEY *key)
...
@@ -210,8 +210,15 @@ ECDH_DATA *ecdh_check(EC_KEY *key)
ecdh_data
=
(
ECDH_DATA
*
)
ecdh_data_new
();
ecdh_data
=
(
ECDH_DATA
*
)
ecdh_data_new
();
if
(
ecdh_data
==
NULL
)
if
(
ecdh_data
==
NULL
)
return
NULL
;
return
NULL
;
EC_KEY_insert_key_method_data
(
key
,
(
void
*
)
ecdh_data
,
data
=
EC_KEY_insert_key_method_data
(
key
,
(
void
*
)
ecdh_data
,
ecdh_data_dup
,
ecdh_data_free
,
ecdh_data_free
);
ecdh_data_dup
,
ecdh_data_free
,
ecdh_data_free
);
if
(
data
!=
NULL
)
{
/* Another thread raced us to install the key_method
* data and won. */
ecdh_data_free
(
ecdh_data
);
ecdh_data
=
(
ECDH_DATA
*
)
data
;
}
}
}
else
else
ecdh_data
=
(
ECDH_DATA
*
)
data
;
ecdh_data
=
(
ECDH_DATA
*
)
data
;
...
...
crypto/ecdsa/ecs_lib.c
浏览文件 @
f11d0c79
...
@@ -188,8 +188,15 @@ ECDSA_DATA *ecdsa_check(EC_KEY *key)
...
@@ -188,8 +188,15 @@ ECDSA_DATA *ecdsa_check(EC_KEY *key)
ecdsa_data
=
(
ECDSA_DATA
*
)
ecdsa_data_new
();
ecdsa_data
=
(
ECDSA_DATA
*
)
ecdsa_data_new
();
if
(
ecdsa_data
==
NULL
)
if
(
ecdsa_data
==
NULL
)
return
NULL
;
return
NULL
;
EC_KEY_insert_key_method_data
(
key
,
(
void
*
)
ecdsa_data
,
data
=
EC_KEY_insert_key_method_data
(
key
,
(
void
*
)
ecdsa_data
,
ecdsa_data_dup
,
ecdsa_data_free
,
ecdsa_data_free
);
ecdsa_data_dup
,
ecdsa_data_free
,
ecdsa_data_free
);
if
(
data
!=
NULL
)
{
/* Another thread raced us to install the key_method
* data and won. */
ecdsa_data_free
(
ecdsa_data
);
ecdsa_data
=
(
ECDSA_DATA
*
)
data
;
}
}
}
else
else
ecdsa_data
=
(
ECDSA_DATA
*
)
data
;
ecdsa_data
=
(
ECDSA_DATA
*
)
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录