Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7e5b0681
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
9 个月 前同步成功
通知
8
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7e5b0681
编写于
6月 02, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Automatically free up dynamically allocated public key methods when
and ENGINE is destroyed.
上级
1892c8bf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
2 deletion
+32
-2
crypto/engine/eng_int.h
crypto/engine/eng_int.h
+4
-0
crypto/engine/eng_lib.c
crypto/engine/eng_lib.c
+2
-0
crypto/engine/eng_list.c
crypto/engine/eng_list.c
+1
-0
crypto/engine/engine.h
crypto/engine/engine.h
+1
-1
crypto/engine/tb_pkmeth.c
crypto/engine/tb_pkmeth.c
+24
-1
未找到文件。
crypto/engine/eng_int.h
浏览文件 @
7e5b0681
...
...
@@ -143,6 +143,10 @@ void engine_set_all_null(ENGINE *e);
/* NB: Bitwise OR-able values for the "flags" variable in ENGINE are now exposed
* in engine.h. */
/* Free up dynamically allocated public key methods associated with ENGINE */
void
engine_pkey_meths_free
(
ENGINE
*
e
);
/* This is a structure for storing implementations of various crypto
* algorithms and functions. */
struct
engine_st
...
...
crypto/engine/eng_lib.c
浏览文件 @
7e5b0681
...
...
@@ -125,6 +125,8 @@ int engine_free_util(ENGINE *e, int locked)
abort
();
}
#endif
/* Free up any dynamically allocated public key methods */
engine_pkey_meths_free
(
e
);
/* Give the ENGINE a chance to do any structural cleanup corresponding
* to allocation it did in its constructor (eg. unload error strings) */
if
(
e
->
destroy
)
...
...
crypto/engine/eng_list.c
浏览文件 @
7e5b0681
...
...
@@ -336,6 +336,7 @@ static void engine_cpy(ENGINE *dest, const ENGINE *src)
dest
->
store_meth
=
src
->
store_meth
;
dest
->
ciphers
=
src
->
ciphers
;
dest
->
digests
=
src
->
digests
;
dest
->
pkey_meths
=
src
->
pkey_meths
;
dest
->
destroy
=
src
->
destroy
;
dest
->
init
=
src
->
init
;
dest
->
finish
=
src
->
finish
;
...
...
crypto/engine/engine.h
浏览文件 @
7e5b0681
...
...
@@ -293,7 +293,7 @@ typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
* parameter is non-NULL it is set to the size of the returned array. */
typedef
int
(
*
ENGINE_CIPHERS_PTR
)(
ENGINE
*
,
const
EVP_CIPHER
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_DIGESTS_PTR
)(
ENGINE
*
,
const
EVP_MD
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_PKEY_METHS_PTR
)(
ENGINE
*
,
const
EVP_PKEY_METHOD
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_PKEY_METHS_PTR
)(
ENGINE
*
,
EVP_PKEY_METHOD
**
,
const
int
**
,
int
);
/* STRUCTURE functions ... all of these functions deal with pointers to ENGINE
* structures where the pointers have a "structural reference". This means that
* their reference is to allowed access to the structure but it does not imply
...
...
crypto/engine/tb_pkmeth.c
浏览文件 @
7e5b0681
...
...
@@ -118,7 +118,7 @@ ENGINE *ENGINE_get_pkey_meth_engine(int nid)
/* Obtains a pkey_meth implementation from an ENGINE functional reference */
const
EVP_PKEY_METHOD
*
ENGINE_get_pkey_meth
(
ENGINE
*
e
,
int
nid
)
{
const
EVP_PKEY_METHOD
*
ret
;
EVP_PKEY_METHOD
*
ret
;
ENGINE_PKEY_METHS_PTR
fn
=
ENGINE_get_pkey_meths
(
e
);
if
(
!
fn
||
!
fn
(
e
,
&
ret
,
NULL
,
nid
))
{
...
...
@@ -141,3 +141,26 @@ int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f)
e
->
pkey_meths
=
f
;
return
1
;
}
/* Internal function to free up EVP_PKEY_METHOD structures before an
* ENGINE is destroyed
*/
void
engine_pkey_meths_free
(
ENGINE
*
e
)
{
int
i
;
EVP_PKEY_METHOD
*
pkm
;
if
(
e
->
pkey_meths
)
{
const
int
*
pknids
;
int
npknids
;
npknids
=
e
->
pkey_meths
(
e
,
NULL
,
&
pknids
,
0
);
for
(
i
=
0
;
i
<
npknids
;
i
++
)
{
if
(
e
->
pkey_meths
(
e
,
&
pkm
,
NULL
,
pknids
[
i
]))
{
EVP_PKEY_meth_free
(
pkm
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录