Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ATS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TST
ATS
Commits
c0eea593
Commit
c0eea593
authored
7 years ago
by
abbas ahmad
Browse files
Options
Downloads
Patches
Plain Diff
Implemented End-to-End Certificate-based Key Establishment Test Purpose => TP/oneM2M/CSE/ESC/BV/002
+ SecurityFunctions group in OneM2M_Functions.ttcn
parent
d357197a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LibOneM2M/OneM2M_Functions.ttcn
+40
-0
40 additions, 0 deletions
LibOneM2M/OneM2M_Functions.ttcn
OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
+58
-7
58 additions, 7 deletions
OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
with
98 additions
and
7 deletions
LibOneM2M/OneM2M_Functions.ttcn
+
40
−
0
View file @
c0eea593
...
@@ -3989,6 +3989,46 @@ module OneM2M_Functions {
...
@@ -3989,6 +3989,46 @@ module OneM2M_Functions {
}
//end of commonFunctions
}
//end of commonFunctions
group
SecurityFunctions
{
function
f_handShake
()
runs
on
CseSimu
{
var
MsgIn
v_response
;
var
RequestPrimitive
v_requestNotify
;
var
PrimitiveContent
v_primitiveContentResponse
;
//Test component configuration
f_cf02UpCse1
();
// Preamble (initial conditions)
//vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
//TestBody
v_requestNotify
.
to_
:=
f_getResourceAddress
(
vc_remoteCseIndex
);
v_requestNotify
.
from_
:=
PX_CSE1_ID
;
v_requestNotify
.
primitiveContent
:=
{
securityInfo
:=
m_contentSecurityInfo
(
int6
)};
v_requestNotify
.
primitiveContent
.
securityInfo
.
escertkeMessage
:=
str2oct
(
"VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw=="
);
v_primitiveContentResponse
.
securityInfo
:=
mw_contentSecurityInfo
(
int6
,
str2oct
(
"VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="
));
mccPort
.
send
(
m_request
(
v_requestNotify
));
tc_ac
.
start
;
alt
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
,
v_primitiveContentResponse
)))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
": Handshake completed successfully"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
inconc
,
__SCOPE__
&
":INFO: Timeout while awaiting the reception of a message"
);
}
}
f_cf02DownCseSimuMaster
();
}
// end f_handShake
}
//end of SecuityFunctions
group
externalFunctions
{
group
externalFunctions
{
/**
/**
...
...
This diff is collapsed.
Click to expand it.
OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
+
58
−
7
View file @
c0eea593
...
@@ -85,29 +85,80 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
...
@@ -85,29 +85,80 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
var
MsgIn
v_response
;
var
MsgIn
v_response
;
var
RequestPrimitive
v_requestNotify
;
var
RequestPrimitive
v_requestNotify
;
var
PrimitiveContent
v_primitiveContentResponse
;
var
PrimitiveContent
v_primitiveContentResponse
;
//Test component configuration
//Test component configuration
f_cf02UpCse1
();
f_cf02UpCse1
();
// Test adapter configuration
// Test adapter configuration
// Preamble
// Preamble
(initial conditions)
vc_remoteCseIndex
:=
f_cse_registerRemoteCse
(
m_createRemoteCSEBase
);
vc_remoteCseIndex
:=
f_cse_registerRemoteCse
(
m_createRemoteCSEBase
);
//TODO => " and the IUT has been provisioned with private key and certificate"
//Preconfiguration => "and the IUT has been provisioned with private key and certificate"
//Test Commit
//TestBody
//TestBody
v_requestNotify
.
to_
:=
f_getResourceAddress
(
vc_remoteCseIndex
);
v_requestNotify
.
to_
:=
f_getResourceAddress
(
vc_remoteCseIndex
);
v_requestNotify
.
from_
:=
PX_CSE1_ID
;
v_requestNotify
.
from_
:=
PX_CSE1_ID
;
v_requestNotify
.
primitiveContent
:=
{
securityInfo
:=
m_contentSecurityInfo
(
int6
)};
v_requestNotify
.
primitiveContent
:=
{
securityInfo
:=
m_contentSecurityInfo
(
int6
)};
v_requestNotify
.
primitiveContent
.
securityInfo
.
escertkeMessage
:=
str2oct
(
"VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw=="
);
//TODO Base 64 representation of message ?
v_requestNotify
.
primitiveContent
.
securityInfo
.
escertkeMessage
:=
str2oct
(
"ClientHello"
);
v_primitiveContentResponse
.
securityInfo
:=
mw_contentSecurityInfo
(
int6
,
str2oct
(
"ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone"
));
v_primitiveContentResponse
.
securityInfo
:=
mw_contentSecurityInfo
(
int6
,
str2oct
(
"VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="
));
mccPort
.
send
(
m_request
(
v_requestNotify
));
mccPort
.
send
(
m_request
(
v_requestNotify
));
tc_ac
.
start
;
tc_ac
.
start
;
alt
{
alt
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
,
v_primitiveContentResponse
)))
->
value
v_response
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
,
v_primitiveContentResponse
)))
->
value
v_response
{
tc_ac
.
stop
;
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
": Message 2 received successfully"
);
setverdict
(
pass
,
__SCOPE__
&
": ESCertKE Message 2 received successfully"
);
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
": Wrong SecurityInfo (securityInfoType ¦¦ escertkeMessage ) Message received"
);
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitiveKO
))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
": Wrong response status code"
);
}
[]
tc_ac
.
timeout
{
setverdict
(
inconc
,
__SCOPE__
&
":INFO: Timeout while awaiting the reception of a message"
);
}
}
f_cse_postamble_deleteResourcesCSE
();
f_cf02DownCseSimuMaster
();
}
testcase
TC_CSE_ESC_BV_002
()
runs
on
CseSimu
system
CseSystem
{
var
MsgIn
v_response
;
var
RequestPrimitive
v_requestNotify
;
var
PrimitiveContent
v_primitiveContentResponse
;
//Test component configuration
f_cf02UpCse1
();
// Test adapter configuration
// Preamble (initial conditions)
vc_remoteCseIndex
:=
f_cse_registerRemoteCse
(
m_createRemoteCSEBase
);
f_handShake
();
//Preconfiguration => "and the IUT has been provisioned with private key and certificate"
//TestBody
v_requestNotify
.
to_
:=
f_getResourceAddress
(
vc_remoteCseIndex
);
v_requestNotify
.
from_
:=
PX_CSE1_ID
;
v_requestNotify
.
primitiveContent
:=
{
securityInfo
:=
m_contentSecurityInfo
(
int6
)};
//TODO Base 64 representation of message ?
v_requestNotify
.
primitiveContent
.
securityInfo
.
escertkeMessage
:=
str2oct
(
"Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished"
);
v_primitiveContentResponse
.
securityInfo
:=
mw_contentSecurityInfo
(
int6
,
str2oct
(
"[ChangeCipherSpec], Finished"
));
mccPort
.
send
(
m_request
(
v_requestNotify
));
tc_ac
.
start
;
alt
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int2000
,
v_primitiveContentResponse
)))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
pass
,
__SCOPE__
&
": ESCertKE Message 4 received successfully"
);
}
}
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
->
value
v_response
{
[]
mccPort
.
receive
(
mw_response
(
mw_responsePrimitiveOK
))
->
value
v_response
{
tc_ac
.
stop
;
tc_ac
.
stop
;
...
@@ -118,7 +169,7 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
...
@@ -118,7 +169,7 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
setverdict
(
fail
,
__SCOPE__
&
": Wrong response status code"
);
setverdict
(
fail
,
__SCOPE__
&
": Wrong response status code"
);
}
}
[]
tc_ac
.
timeout
{
[]
tc_ac
.
timeout
{
setverdict
(
inconc
,
__SCOPE__
&
":INFO: Timeout while awaiting the reception of a message"
);
setverdict
(
inconc
,
__SCOPE__
&
":INFO: Timeout while awaiting the reception of a message"
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment