Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
88fce853
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看板
提交
88fce853
编写于
3月 15, 2008
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial support for enveloped data decrypt. Extent runex.pl to cover these
examples. All RFC4134 examples can now be processed.
上级
4f1aa191
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
7 deletion
+47
-7
test/runex.pl
test/runex.pl
+47
-7
未找到文件。
test/runex.pl
浏览文件 @
88fce853
...
...
@@ -58,6 +58,7 @@ my $verbose = 1;
my
$cmscmd
=
"
../util/shlib_wrap.sh ../apps/openssl cms
";
my
$convcmd
=
"
../util/shlib_wrap.sh ../apps/openssl x509 -inform DER
";
my
$pconvcmd
=
"
../util/shlib_wrap.sh ../apps/openssl rsa -inform DER
";
my
$exdir
=
"
examples
";
my
@test_list
=
(
...
...
@@ -74,8 +75,9 @@ my @test_list = (
["
4.9.eml
"
=>
"
verifymime, dss
"],
["
4.10.bin
"
=>
"
encode, verifyder, cont, dss
"],
["
4.11.bin
"
=>
"
encode
"],
["
5.1.bin
"
=>
"
encode
"],
["
5.2.bin
"
=>
"
encode
"],
["
5.1.bin
"
=>
"
encode, envelopeder, cont
"],
["
5.2.bin
"
=>
"
encode, envelopeder, cont
"],
["
5.3.eml
"
=>
"
envelopemime, cont
"],
["
6.0.bin
"
=>
"
encode, digest, cont
"],
["
7.1.bin
"
=>
"
encode, encrypted, cont
"],
["
7.2.bin
"
=>
"
encode, encrypted, cont
"]
...
...
@@ -91,8 +93,8 @@ my $secretkey = "73:7c:79:1f:25:ea:d0:e0:46:29:25:43:52:f7:dc:62:91:e5:cb:26:91:
system
("
$convcmd
-in
$exdir
/CarlDSSSelf.cer -out
$exdir
/CarlDSSSelf.pem
");
system
("
$convcmd
-in
$exdir
/CarlRSASelf.cer -out
$exdir
/CarlRSASelf.pem
");
$cafile
=
"
$cmsdir
/CarlRSASelf.pem
"
if
$tlist
=~
/rsa/
;
system
("
$convcmd
-in
$exdir
/BobRSASignByCarl.cer -out
$exdir
/BobRSASignByCarl.pem
");
system
("
$pconvcmd
-in
$exdir
/BobPrivRSAEncrypt.pri -out
$exdir
/BobPrivRSAEncrypt.pem
")
;
foreach
(
@test_list
)
{
my
(
$file
,
$tlist
)
=
@$_
;
...
...
@@ -117,6 +119,10 @@ foreach (@test_list) {
{
run_encrypted_test
(
$exdir
,
$tlist
,
$file
,
$secretkey
);
}
if
(
$tlist
=~
/envelope/
)
{
run_envelope_test
(
$exdir
,
$tlist
,
$file
);
}
}
...
...
@@ -194,7 +200,7 @@ sub run_verify_test
"
-CAfile
$cafile
"
.
"
-in
$cmsdir
/
$tfile
-out tmp.txt
";
$cmd
.=
"
-content
$cmsdir
/ExContent.bin
"
if
$tlist
=~
/cont_extern/
;
$cmd
.=
"
-content
$cmsdir
/ExContent.bin
"
if
$tlist
=~
/cont_extern/
;
system
("
$cmd
2>cms.err 1>cms.out
");
...
...
@@ -215,13 +221,47 @@ sub run_verify_test
}
}
sub
run_envelope_test
{
my
(
$cmsdir
,
$tlist
,
$tfile
)
=
@_
;
unlink
"
tmp.txt
";
$form
=
"
DER
"
if
$tlist
=~
/envelopeder/
;
$form
=
"
SMIME
"
if
$tlist
=~
/envelopemime/
;
$cmd
=
"
$cmscmd
-decrypt -inform
$form
"
.
"
-recip
$cmsdir
/BobRSASignByCarl.pem
"
.
"
-inkey
$cmsdir
/BobPrivRSAEncrypt.pem
"
.
"
-in
$cmsdir
/
$tfile
-out tmp.txt
";
system
("
$cmd
2>cms.err 1>cms.out
");
if
(
$?
)
{
print
"
\t
Decrypt command FAILED!!
\n
";
$badtest
++
;
}
elsif
(
$tlist
=~
/cont/
&&
!
cmp_files
("
$cmsdir
/ExContent.bin
",
"
tmp.txt
"))
{
print
"
\t
Decrypt content compare FAILED!!
\n
";
$badtest
++
;
}
else
{
print
"
\t
Decrypt passed
\n
"
if
$verbose
;
}
}
sub
run_digest_test
{
my
(
$cmsdir
,
$tlist
,
$tfile
)
=
@_
;
unlink
"
tmp.txt
";
system
("
$cmscmd
-digest_verify -inform DER
"
.
"
-in
$cmsdir
/
$tfile
-out tmp.txt
");
my
$cmd
=
"
$cmscmd
-digest_verify -inform DER
"
.
"
-in
$cmsdir
/
$tfile
-out tmp.txt
";
system
("
$cmd
2>cms.err 1>cms.out
");
if
(
$?
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录