Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
e90fadda
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e90fadda
编写于
12月 29, 2004
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prompt for passphrases for PKCS12 input format
上级
f1ce306f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
10 deletion
+55
-10
CHANGES
CHANGES
+3
-0
apps/apps.c
apps/apps.c
+52
-10
未找到文件。
CHANGES
浏览文件 @
e90fadda
...
...
@@ -750,6 +750,9 @@
Changes between 0.9.7e and 0.9.7f [XX xxx XXXX]
*) Prompt for pass phrases when appropriate for PKCS12 input format.
[Steve Henson]
*) Add lots of checks for memory allocation failure, error codes to indicate
failure and freeing up memory if a failure occurs.
[Nauticus Networks SSL Team <openssl@nauticusnet.com>, Steve Henson]
...
...
apps/apps.c
浏览文件 @
e90fadda
...
...
@@ -688,6 +688,51 @@ int add_oid_section(BIO *err, CONF *conf)
return
1
;
}
static
int
load_pkcs12
(
BIO
*
err
,
BIO
*
in
,
const
char
*
desc
,
pem_password_cb
*
pem_cb
,
void
*
cb_data
,
EVP_PKEY
**
pkey
,
X509
**
cert
,
STACK_OF
(
X509
)
**
ca
)
{
const
char
*
pass
;
char
tpass
[
PEM_BUFSIZE
];
int
len
,
ret
=
0
;
PKCS12
*
p12
;
p12
=
d2i_PKCS12_bio
(
in
,
NULL
);
if
(
p12
==
NULL
)
{
BIO_printf
(
err
,
"Error loading PKCS12 file for %s
\n
"
,
desc
);
goto
err
;
}
/* See if an empty password will do */
if
(
PKCS12_verify_mac
(
p12
,
""
,
0
)
||
PKCS12_verify_mac
(
p12
,
NULL
,
0
))
pass
=
""
;
else
{
if
(
!
pem_cb
)
pem_cb
=
(
pem_password_cb
*
)
password_callback
;
len
=
pem_cb
(
tpass
,
PEM_BUFSIZE
,
0
,
cb_data
);
if
(
len
<
0
)
{
BIO_printf
(
err
,
"Passpharse callback error for %s
\n
"
,
desc
);
goto
err
;
}
if
(
len
<
PEM_BUFSIZE
)
tpass
[
len
]
=
0
;
if
(
!
PKCS12_verify_mac
(
p12
,
tpass
,
len
))
{
BIO_printf
(
err
,
"Mac verify error (wrong password?) in PKCS12 file for %s
\n
"
,
desc
);
goto
err
;
}
pass
=
tpass
;
}
ret
=
PKCS12_parse
(
p12
,
pass
,
pkey
,
cert
,
ca
);
err:
if
(
p12
)
PKCS12_free
(
p12
);
return
ret
;
}
X509
*
load_cert
(
BIO
*
err
,
const
char
*
file
,
int
format
,
const
char
*
pass
,
ENGINE
*
e
,
const
char
*
cert_descrip
)
{
...
...
@@ -768,11 +813,9 @@ X509 *load_cert(BIO *err, const char *file, int format,
(
pem_password_cb
*
)
password_callback
,
NULL
);
else
if
(
format
==
FORMAT_PKCS12
)
{
PKCS12
*
p12
=
d2i_PKCS12_bio
(
cert
,
NULL
);
PKCS12_parse
(
p12
,
NULL
,
NULL
,
&
x
,
NULL
);
PKCS12_free
(
p12
);
p12
=
NULL
;
if
(
!
load_pkcs12
(
err
,
cert
,
cert_descrip
,
NULL
,
NULL
,
NULL
,
&
x
,
NULL
))
goto
end
;
}
else
{
BIO_printf
(
err
,
"bad input format specified for %s
\n
"
,
...
...
@@ -851,11 +894,10 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
#endif
else
if
(
format
==
FORMAT_PKCS12
)
{
PKCS12
*
p12
=
d2i_PKCS12_bio
(
key
,
NULL
);
PKCS12_parse
(
p12
,
pass
,
&
pkey
,
NULL
,
NULL
);
PKCS12_free
(
p12
);
p12
=
NULL
;
if
(
!
load_pkcs12
(
err
,
key
,
key_descrip
,
(
pem_password_cb
*
)
password_callback
,
&
cb_data
,
&
pkey
,
NULL
,
NULL
))
goto
end
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录