Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c27a4049
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,发现更多精彩内容 >>
提交
c27a4049
编写于
8月 28, 2015
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remake test/sslsessionticktest.pl into a recipe
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
25be5f44
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
52 addition
and
39 deletion
+52
-39
test/recipes/70-test_sslsessiontick.t
test/recipes/70-test_sslsessiontick.t
+52
-39
未找到文件。
test/
sslsessionticktest.pl
→
test/
recipes/70-test_sslsessiontick.t
浏览文件 @
c27a4049
...
@@ -53,9 +53,24 @@
...
@@ -53,9 +53,24 @@
# Hudson (tjh@cryptsoft.com).
# Hudson (tjh@cryptsoft.com).
use
strict
;
use
strict
;
use
OpenSSL::
Test
qw/:DEFAULT cmdstr top_file top_dir/
;
use
TLSProxy::
Proxy
;
use
TLSProxy::
Proxy
;
use
File::
Temp
qw(tempfile)
;
use
File::
Temp
qw(tempfile)
;
my
$test_name
=
"
test_sslsessiontick
";
setup
(
$test_name
);
plan
skip_all
=>
"
$test_name
can only be performed with OpenSSL configured shared
"
unless
(
map
{
chomp
;
s/^SHARED_LIBS=\s*//
;
$_
}
grep
{
/^SHARED_LIBS=/
}
do
{
local
@ARGV
=
(
top_file
("
Makefile
")
);
<>
})[
0
]
ne
"";
$ENV
{
OPENSSL_ENGINES
}
=
top_dir
("
engines
");
$ENV
{
OPENSSL_ia32cap
}
=
'
~0x200000200000000
';
sub
checkmessages
($$$$$$);
sub
clearall
();
my
$chellotickext
=
0
;
my
$chellotickext
=
0
;
my
$shellotickext
=
0
;
my
$shellotickext
=
0
;
my
$fullhand
=
0
;
my
$fullhand
=
0
;
...
@@ -63,9 +78,12 @@ my $ticketseen = 0;
...
@@ -63,9 +78,12 @@ my $ticketseen = 0;
my
$proxy
=
TLSProxy::
Proxy
->
new
(
my
$proxy
=
TLSProxy::
Proxy
->
new
(
undef
,
undef
,
@ARGV
cmdstr
(
app
(["
openssl
"])),
top_file
("
apps
",
"
server.pem
")
);
);
plan
tests
=>
5
;
#Test 1: By default with no existing session we should get a session ticket
#Test 1: By default with no existing session we should get a session ticket
#Expected result: ClientHello extension seen; ServerHello extension seen
#Expected result: ClientHello extension seen; ServerHello extension seen
# NewSessionTicket message seen; Full handshake
# NewSessionTicket message seen; Full handshake
...
@@ -107,7 +125,7 @@ checkmessages(4, "Session resumption session ticket test", 1, 0, 0, 0);
...
@@ -107,7 +125,7 @@ checkmessages(4, "Session resumption session ticket test", 1, 0, 0, 0);
#Expected result: ClientHello extension seen; ServerHello extension seen
#Expected result: ClientHello extension seen; ServerHello extension seen
# NewSessionTicket message seen; Abbreviated handshake
# NewSessionTicket message seen; Abbreviated handshake
clearall
();
clearall
();
(
my
$fh
,
my
$session
)
=
tempfile
();
(
$fh
,
$session
)
=
tempfile
();
$proxy
->
serverconnects
(
2
);
$proxy
->
serverconnects
(
2
);
$proxy
->
clientflags
("
-sess_out
"
.
$session
.
"
-no_ticket
");
$proxy
->
clientflags
("
-sess_out
"
.
$session
.
"
-no_ticket
");
$proxy
->
start
();
$proxy
->
start
();
...
@@ -117,50 +135,45 @@ $proxy->clientstart();
...
@@ -117,50 +135,45 @@ $proxy->clientstart();
checkmessages
(
5
,
"
Session resumption with ticket capable client without a
"
checkmessages
(
5
,
"
Session resumption with ticket capable client without a
"
.
"
ticket
",
1
,
1
,
1
,
0
);
.
"
ticket
",
1
,
1
,
1
,
0
);
sub
checkmessages
()
sub
checkmessages
(
$$$$$$
)
{
{
my
(
$testno
,
$testname
,
$testch
,
$testsh
,
$testtickseen
,
$testhand
)
=
@_
;
my
(
$testno
,
$testname
,
$testch
,
$testsh
,
$testtickseen
,
$testhand
)
=
@_
;
foreach
my
$message
(
@
{
$proxy
->
message_list
})
{
subtest
$testname
=>
sub
{
if
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_HELLO
foreach
my
$message
(
@
{
$proxy
->
message_list
})
{
if
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_HELLO
||
$message
->
mt
==
TLSProxy::Message::
MT_SERVER_HELLO
)
{
||
$message
->
mt
==
TLSProxy::Message::
MT_SERVER_HELLO
)
{
#Get the extensions data
#Get the extensions data
my
%extensions
=
%
{
$message
->
extension_data
};
my
%extensions
=
%
{
$message
->
extension_data
};
if
(
defined
if
(
defined
$extensions
{
TLSProxy::ClientHello::
EXT_SESSION_TICKET
})
{
$extensions
{
TLSProxy::ClientHello::
EXT_SESSION_TICKET
})
{
if
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_HELLO
)
{
if
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_HELLO
)
{
$chellotickext
=
1
;
$chellotickext
=
1
;
}
else
{
}
else
{
$shellotickext
=
1
;
$shellotickext
=
1
;
}
}
}
}
}
elsif
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_KEY_EXCHANGE
)
{
}
elsif
(
$message
->
mt
==
TLSProxy::Message::
MT_CLIENT_KEY_EXCHANGE
)
{
#Must be doing a full handshake
#Must be doing a full handshake
$fullhand
=
1
;
$fullhand
=
1
;
}
elsif
(
$message
->
mt
==
TLSProxy::Message::
MT_NEW_SESSION_TICKET
)
{
}
elsif
(
$message
->
mt
==
TLSProxy::Message::
MT_NEW_SESSION_TICKET
)
{
$ticketseen
=
1
;
$ticketseen
=
1
;
}
}
}
}
TLSProxy::
Message
->
success
or
die
"
FAILED:
$testname
: Hanshake failed
"
plan
tests
=>
5
;
.
"
(Test
$testno
)
\n
";
if
((
$testch
&&
!
$chellotickext
)
||
(
!
$testch
&&
$chellotickext
))
{
ok
(
TLSProxy::
Message
->
success
,
"
Hanshake
");
die
"
FAILED:
$testname
: ClientHello extension Session Ticket check
"
ok
((
$testch
&&
$chellotickext
)
||
(
!
$testch
&&
!
$chellotickext
),
.
"
failed (Test
$testno
)
\n
";
"
ClientHello extension Session Ticket check
");
}
ok
((
$testsh
&&
$shellotickext
)
||
(
!
$testsh
&&
!
$shellotickext
),
if
((
$testsh
&&
!
$shellotickext
)
||
(
!
$testsh
&&
$shellotickext
))
{
"
ServerHello extension Session Ticket check
");
die
"
FAILED:
$testname
: ServerHello extension Session Ticket check
"
ok
((
$testtickseen
&&
$ticketseen
)
||
(
!
$testtickseen
&&
!
$ticketseen
),
.
"
failed (Test
$testno
)
\n
";
"
Session Ticket message presence check
");
}
ok
((
$testhand
&&
$fullhand
)
||
(
!
$testhand
&&
!
$fullhand
),
if
((
$testtickseen
&&
!
$ticketseen
)
||
(
!
$testtickseen
&&
$ticketseen
))
{
"
Session Ticket full handshake check
");
die
"
FAILED:
$testname
: Session Ticket message presence check failed
"
.
"
(Test
$testno
)
\n
";
}
if
((
$testhand
&&
!
$fullhand
)
||
(
!
$testhand
&&
$fullhand
))
{
die
"
FAILED:
$testname
: Session Ticket full handshake check failed
"
.
"
(Test
$testno
)
\n
";
}
}
print
"
SUCCESS:
$testname
(Test#
$testno
)
\n
";
}
}
sub
clearall
()
sub
clearall
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录