Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
c11237c2
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c11237c2
编写于
11月 15, 2016
作者:
M
Matt Caswell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a test for the TLSv1.3 state machine
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
20b65c7b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
86 addition
and
0 deletion
+86
-0
test/recipes/70-test_tls13messages.t
test/recipes/70-test_tls13messages.t
+86
-0
未找到文件。
test/recipes/70-test_tls13messages.t
0 → 100755
浏览文件 @
c11237c2
#! /usr/bin/env perl
# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
use
strict
;
use
OpenSSL::
Test
qw/:DEFAULT cmdstr srctop_file bldtop_dir/
;
use
OpenSSL::Test::
Utils
;
use
TLSProxy::
Proxy
;
my
$test_name
=
"
test_tls13messages
";
setup
(
$test_name
);
plan
skip_all
=>
"
TLSProxy isn't usable on $^O
"
if
$^O
=~
/^(VMS|MSWin32)$/
;
plan
skip_all
=>
"
$test_name
needs the dynamic engine feature enabled
"
if
disabled
("
engine
")
||
disabled
("
dynamic-engine
");
plan
skip_all
=>
"
$test_name
needs the sock feature enabled
"
if
disabled
("
sock
");
plan
skip_all
=>
"
$test_name
needs TLSv1.3 enabled
"
if
disabled
("
tls1_3
");
$ENV
{
OPENSSL_ia32cap
}
=
'
~0x200000200000000
';
use
constant
{
DEFAULT_HANDSHAKE
=>
1
};
my
@handmessages
=
(
[
TLSProxy::Message::
MT_CLIENT_HELLO
,
DEFAULT_HANDSHAKE
],
[
TLSProxy::Message::
MT_SERVER_HELLO
,
DEFAULT_HANDSHAKE
],
[
TLSProxy::Message::
MT_CERTIFICATE
,
DEFAULT_HANDSHAKE
],
[
TLSProxy::Message::
MT_FINISHED
,
DEFAULT_HANDSHAKE
],
[
TLSProxy::Message::
MT_FINISHED
,
DEFAULT_HANDSHAKE
],
[
0
,
0
]
);
my
$proxy
=
TLSProxy::
Proxy
->
new
(
undef
,
cmdstr
(
app
(["
openssl
"]),
display
=>
1
),
srctop_file
("
apps
",
"
server.pem
"),
(
!
$ENV
{
HARNESS_ACTIVE
}
||
$ENV
{
HARNESS_VERBOSE
})
);
sub
checkmessages
($$);
#Test 1: Check we get all the right messages for a default handshake
$proxy
->
start
()
or
plan
skip_all
=>
"
Unable to start up Proxy for tests
";
plan
tests
=>
1
;
checkmessages
(
DEFAULT_HANDSHAKE
,
"
Default handshake test
");
sub
checkmessages
($$)
{
my
(
$handtype
,
$testname
)
=
@_
;
subtest
$testname
=>
sub
{
my
$loop
=
0
;
my
$numtests
;
#First count the number of tests
for
(
$numtests
=
1
;
$handmessages
[
$loop
][
1
]
!=
0
;
$loop
++
)
{
$numtests
++
if
((
$handmessages
[
$loop
][
1
]
&
$handtype
)
!=
0
);
}
plan
tests
=>
$numtests
;
$loop
=
0
;
foreach
my
$message
(
@
{
$proxy
->
message_list
})
{
for
(;
$handmessages
[
$loop
][
1
]
!=
0
&&
(
$handmessages
[
$loop
][
1
]
&
$handtype
)
==
0
;
$loop
++
)
{
next
;
}
ok
(
$handmessages
[
$loop
][
1
]
!=
0
&&
$message
->
mt
==
$handmessages
[
$loop
][
0
],
"
Message type check. Got
"
.
$message
->
mt
.
"
, expected
"
.
$handmessages
[
$loop
][
0
]);
$loop
++
;
}
ok
(
$handmessages
[
$loop
][
1
]
==
0
,
"
All expected messages processed
");
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录