Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
5b17b79a
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看板
提交
5b17b79a
编写于
12月 09, 2013
作者:
K
Kurt Roeckx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
capi_ctrl, capi_vtrace: check for NULL after allocating and free it
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
3a7581bf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
1 deletion
+16
-1
engines/e_capi.c
engines/e_capi.c
+11
-0
engines/e_capi_err.c
engines/e_capi_err.c
+3
-1
engines/e_capi_err.h
engines/e_capi_err.h
+2
-0
未找到文件。
engines/e_capi.c
浏览文件 @
5b17b79a
...
...
@@ -340,6 +340,11 @@ static int capi_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
}
ctx
=
ENGINE_get_ex_data
(
e
,
capi_idx
);
out
=
BIO_new_fp
(
stdout
,
BIO_NOCLOSE
);
if
(
out
==
NULL
)
{
CAPIerr
(
CAPI_F_CAPI_CTRL
,
CAPI_R_FILE_OPEN_ERROR
);
return
0
;
}
switch
(
cmd
)
{
case
CAPI_CMD_LIST_CSPS
:
...
...
@@ -406,6 +411,7 @@ static int capi_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
if
(
i
<
1
||
i
>
3
)
{
CAPIerr
(
CAPI_F_CAPI_CTRL
,
CAPI_R_INVALID_LOOKUP_METHOD
);
BIO_free
(
out
);
return
0
;
}
ctx
->
lookup_method
=
i
;
...
...
@@ -1081,6 +1087,11 @@ static void capi_vtrace(CAPI_CTX *ctx, int level, char *format, va_list argptr)
if
(
!
ctx
||
(
ctx
->
debug_level
<
level
)
||
(
!
ctx
->
debug_file
))
return
;
out
=
BIO_new_file
(
ctx
->
debug_file
,
"a+"
);
if
(
out
==
NULL
)
{
CAPIerr
(
CAPI_F_CAPI_VTRACE
,
CAPI_R_FILE_OPEN_ERROR
);
return
;
}
BIO_vprintf
(
out
,
format
,
argptr
);
BIO_free
(
out
);
}
...
...
engines/e_capi_err.c
浏览文件 @
5b17b79a
/* e_capi_err.c */
/* ====================================================================
* Copyright (c) 1999-20
08
The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-20
14
The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -86,6 +86,7 @@ static ERR_STRING_DATA CAPI_str_functs[]=
{
ERR_FUNC
(
CAPI_F_CAPI_RSA_PRIV_DEC
),
"CAPI_RSA_PRIV_DEC"
},
{
ERR_FUNC
(
CAPI_F_CAPI_RSA_PRIV_ENC
),
"CAPI_RSA_PRIV_ENC"
},
{
ERR_FUNC
(
CAPI_F_CAPI_RSA_SIGN
),
"CAPI_RSA_SIGN"
},
{
ERR_FUNC
(
CAPI_F_CAPI_VTRACE
),
"CAPI_VTRACE"
},
{
ERR_FUNC
(
CAPI_F_CERT_SELECT_DIALOG
),
"CERT_SELECT_DIALOG"
},
{
ERR_FUNC
(
CAPI_F_CLIENT_CERT_SELECT
),
"CLIENT_CERT_SELECT"
},
{
ERR_FUNC
(
CAPI_F_WIDE_TO_ASC
),
"WIDE_TO_ASC"
},
...
...
@@ -109,6 +110,7 @@ static ERR_STRING_DATA CAPI_str_reasons[]=
{
ERR_REASON
(
CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO
),
"error getting key provider info"
},
{
ERR_REASON
(
CAPI_R_ERROR_OPENING_STORE
)
,
"error opening store"
},
{
ERR_REASON
(
CAPI_R_ERROR_SIGNING_HASH
)
,
"error signing hash"
},
{
ERR_REASON
(
CAPI_R_FILE_OPEN_ERROR
)
,
"file open error"
},
{
ERR_REASON
(
CAPI_R_FUNCTION_NOT_SUPPORTED
),
"function not supported"
},
{
ERR_REASON
(
CAPI_R_GETUSERKEY_ERROR
)
,
"getuserkey error"
},
{
ERR_REASON
(
CAPI_R_INVALID_DIGEST_LENGTH
),
"invalid digest length"
},
...
...
engines/e_capi_err.h
浏览文件 @
5b17b79a
...
...
@@ -87,6 +87,7 @@ static void ERR_CAPI_error(int function, int reason, char *file, int line);
#define CAPI_F_CAPI_RSA_PRIV_DEC 110
#define CAPI_F_CAPI_RSA_PRIV_ENC 111
#define CAPI_F_CAPI_RSA_SIGN 112
#define CAPI_F_CAPI_VTRACE 118
#define CAPI_F_CERT_SELECT_DIALOG 117
#define CAPI_F_CLIENT_CERT_SELECT 116
#define CAPI_F_WIDE_TO_ASC 113
...
...
@@ -107,6 +108,7 @@ static void ERR_CAPI_error(int function, int reason, char *file, int line);
#define CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 109
#define CAPI_R_ERROR_OPENING_STORE 110
#define CAPI_R_ERROR_SIGNING_HASH 111
#define CAPI_R_FILE_OPEN_ERROR 128
#define CAPI_R_FUNCTION_NOT_SUPPORTED 112
#define CAPI_R_GETUSERKEY_ERROR 113
#define CAPI_R_INVALID_DIGEST_LENGTH 124
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录