Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c0cf5b84
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看板
提交
c0cf5b84
编写于
6月 04, 2015
作者:
R
Rich Salz
提交者:
Rich Salz
6月 04, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set error code, no fprintf stderr, on errors.
Reviewed-by:
N
Richard Levitte
<
levitte@openssl.org
>
上级
6c40d469
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
6 deletion
+26
-6
crypto/ts/ts_conf.c
crypto/ts/ts_conf.c
+7
-5
crypto/ts/ts_err.c
crypto/ts/ts_err.c
+10
-1
include/openssl/ts.h
include/openssl/ts.h
+9
-0
未找到文件。
crypto/ts/ts_conf.c
浏览文件 @
c0cf5b84
...
...
@@ -102,7 +102,7 @@ X509 *TS_CONF_load_cert(const char *file)
x
=
PEM_read_bio_X509_AUX
(
cert
,
NULL
,
NULL
,
NULL
);
end:
if
(
x
==
NULL
)
fprintf
(
stderr
,
"unable to load certificate: %s
\n
"
,
file
);
TSerr
(
TS_F_TS_CONF_LOAD_CERT
,
TS_R_CANNOT_LOAD_CERT
);
BIO_free
(
cert
);
return
x
;
}
...
...
@@ -129,7 +129,7 @@ STACK_OF(X509) *TS_CONF_load_certs(const char *file)
}
end:
if
(
othercerts
==
NULL
)
fprintf
(
stderr
,
"unable to load certificates: %s
\n
"
,
file
);
TSerr
(
TS_F_TS_CONF_LOAD_CERTS
,
TS_R_CANNOT_LOAD_CERT
);
sk_X509_INFO_pop_free
(
allcerts
,
X509_INFO_free
);
BIO_free
(
certs
);
return
othercerts
;
...
...
@@ -145,7 +145,7 @@ EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass)
pkey
=
PEM_read_bio_PrivateKey
(
key
,
NULL
,
NULL
,
(
char
*
)
pass
);
end:
if
(
pkey
==
NULL
)
fprintf
(
stderr
,
"unable to load private key: %s
\n
"
,
file
);
TSerr
(
TS_F_TS_CONF_LOAD_KEY
,
TS_R_CANNOT_LOAD_KEY
);
BIO_free
(
key
);
return
pkey
;
}
...
...
@@ -154,12 +154,14 @@ EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass)
static
void
ts_CONF_lookup_fail
(
const
char
*
name
,
const
char
*
tag
)
{
fprintf
(
stderr
,
"variable lookup failed for %s::%s
\n
"
,
name
,
tag
);
TSerr
(
TS_F_TS_CONF_LOOKUP_FAIL
,
TS_R_VAR_LOOKUP_FAILURE
);
ERR_add_error_data
(
3
,
name
,
"::"
,
tag
);
}
static
void
ts_CONF_invalid
(
const
char
*
name
,
const
char
*
tag
)
{
fprintf
(
stderr
,
"invalid variable value for %s::%s
\n
"
,
name
,
tag
);
TSerr
(
TS_F_TS_CONF_INVALID
,
TS_R_VAR_BAD_VALUE
);
ERR_add_error_data
(
3
,
name
,
"::"
,
tag
);
}
const
char
*
TS_CONF_get_tsa_section
(
CONF
*
conf
,
const
char
*
section
)
...
...
crypto/ts/ts_err.c
浏览文件 @
c0cf5b84
/* crypto/ts/ts_err.c */
/* ====================================================================
* Copyright (c) 1999-20
07
The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-20
15
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
...
...
@@ -87,6 +87,11 @@ static ERR_STRING_DATA TS_str_functs[] = {
{
ERR_FUNC
(
TS_F_TS_CHECK_SIGNING_CERTS
),
"TS_CHECK_SIGNING_CERTS"
},
{
ERR_FUNC
(
TS_F_TS_CHECK_STATUS_INFO
),
"TS_CHECK_STATUS_INFO"
},
{
ERR_FUNC
(
TS_F_TS_COMPUTE_IMPRINT
),
"TS_COMPUTE_IMPRINT"
},
{
ERR_FUNC
(
TS_F_TS_CONF_INVALID
),
"ts_CONF_invalid"
},
{
ERR_FUNC
(
TS_F_TS_CONF_LOAD_CERT
),
"TS_CONF_load_cert"
},
{
ERR_FUNC
(
TS_F_TS_CONF_LOAD_CERTS
),
"TS_CONF_load_certs"
},
{
ERR_FUNC
(
TS_F_TS_CONF_LOAD_KEY
),
"TS_CONF_load_key"
},
{
ERR_FUNC
(
TS_F_TS_CONF_LOOKUP_FAIL
),
"ts_CONF_lookup_fail"
},
{
ERR_FUNC
(
TS_F_TS_CONF_SET_DEFAULT_ENGINE
),
"TS_CONF_set_default_engine"
},
{
ERR_FUNC
(
TS_F_TS_GET_STATUS_TEXT
),
"TS_GET_STATUS_TEXT"
},
{
ERR_FUNC
(
TS_F_TS_MSG_IMPRINT_SET_ALGO
),
"TS_MSG_IMPRINT_set_algo"
},
...
...
@@ -132,6 +137,8 @@ static ERR_STRING_DATA TS_str_functs[] = {
static
ERR_STRING_DATA
TS_str_reasons
[]
=
{
{
ERR_REASON
(
TS_R_BAD_PKCS7_TYPE
),
"bad pkcs7 type"
},
{
ERR_REASON
(
TS_R_BAD_TYPE
),
"bad type"
},
{
ERR_REASON
(
TS_R_CANNOT_LOAD_CERT
),
"cannot load certificate"
},
{
ERR_REASON
(
TS_R_CANNOT_LOAD_KEY
),
"cannot load private key"
},
{
ERR_REASON
(
TS_R_CERTIFICATE_VERIFY_ERROR
),
"certificate verify error"
},
{
ERR_REASON
(
TS_R_COULD_NOT_SET_ENGINE
),
"could not set engine"
},
{
ERR_REASON
(
TS_R_COULD_NOT_SET_TIME
),
"could not set time"
},
...
...
@@ -170,6 +177,8 @@ static ERR_STRING_DATA TS_str_reasons[] = {
{
ERR_REASON
(
TS_R_UNACCEPTABLE_POLICY
),
"unacceptable policy"
},
{
ERR_REASON
(
TS_R_UNSUPPORTED_MD_ALGORITHM
),
"unsupported md algorithm"
},
{
ERR_REASON
(
TS_R_UNSUPPORTED_VERSION
),
"unsupported version"
},
{
ERR_REASON
(
TS_R_VAR_BAD_VALUE
),
"var bad value"
},
{
ERR_REASON
(
TS_R_VAR_LOOKUP_FAILURE
),
"cannot find config variable"
},
{
ERR_REASON
(
TS_R_WRONG_CONTENT_TYPE
),
"wrong content type"
},
{
0
,
NULL
}
};
...
...
include/openssl/ts.h
浏览文件 @
c0cf5b84
...
...
@@ -775,6 +775,11 @@ void ERR_load_TS_strings(void);
# define TS_F_TS_CHECK_SIGNING_CERTS 103
# define TS_F_TS_CHECK_STATUS_INFO 104
# define TS_F_TS_COMPUTE_IMPRINT 145
# define TS_F_TS_CONF_INVALID 151
# define TS_F_TS_CONF_LOAD_CERT 153
# define TS_F_TS_CONF_LOAD_CERTS 154
# define TS_F_TS_CONF_LOAD_KEY 155
# define TS_F_TS_CONF_LOOKUP_FAIL 152
# define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146
# define TS_F_TS_GET_STATUS_TEXT 105
# define TS_F_TS_MSG_IMPRINT_SET_ALGO 118
...
...
@@ -813,6 +818,8 @@ void ERR_load_TS_strings(void);
/* Reason codes. */
# define TS_R_BAD_PKCS7_TYPE 132
# define TS_R_BAD_TYPE 133
# define TS_R_CANNOT_LOAD_CERT 137
# define TS_R_CANNOT_LOAD_KEY 138
# define TS_R_CERTIFICATE_VERIFY_ERROR 100
# define TS_R_COULD_NOT_SET_ENGINE 127
# define TS_R_COULD_NOT_SET_TIME 115
...
...
@@ -845,6 +852,8 @@ void ERR_load_TS_strings(void);
# define TS_R_UNACCEPTABLE_POLICY 125
# define TS_R_UNSUPPORTED_MD_ALGORITHM 126
# define TS_R_UNSUPPORTED_VERSION 113
# define TS_R_VAR_BAD_VALUE 135
# define TS_R_VAR_LOOKUP_FAILURE 136
# define TS_R_WRONG_CONTENT_TYPE 114
#ifdef __cplusplus
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录