diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 9e658769a3e0ed065bb62af8cf0d50de3c461242..4b216eeda262767f6832d0c8f06a184e317c8e9e 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -4008,8 +4008,8 @@ module OneM2M_Functions { 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=")); + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50IEhlbGxv"); + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU=")); mccPort.send(m_request(v_requestNotify)); tc_ac.start; diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index cffd3af1f12afccbf060ba3d3979a83abc6ec8cb..c05d3ae0a96556b5a3f53ce07b858db4d72d7f31 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1358,13 +1358,15 @@ module OneM2M_Templates { * @desc SecurityInfo content * @param p_securityInfoType security type integer */ - template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in XSD.Base64Binary p_escertkeMessage) := { + template SecurityInfo mw_contentSecurityInfo (in SecurityInfoType p_securityInfoType, in template (omit) XSD.Base64Binary p_escertkeMessage := omit, in template (omit) DynAuthDasRequest p_dasRequest:=omit ) := { securityInfoType := p_securityInfoType, dasRequest := *, dasResponse := *, esprimRandObject := *, esprimObject := *, escertkeMessage := p_escertkeMessage + + //dynAuthDasRequest } diff --git a/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn b/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn index 15a2122549c451ce3440e286995f8a93ce1a21e4..79e8b17b2374f48d3c56f6094b4ad86ea7e5f586 100644 --- a/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn +++ b/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn @@ -13,6 +13,8 @@ */ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { + import from LibCommon_BasicTypesAndValues all; + import from OneM2M_TestSystem all; import from OneM2M_Templates all; import from OneM2M_Types all;//{type XSD.ID}; @@ -77,8 +79,74 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { }//end group oneM2M_demos + group AE { + + group ESCertKE { + + } + + } + group CSE { + group DAS { + + testcase TC_CSE_DAS_BV_001() runs on AeSimu system CseSystem { + + var MsgIn v_response; + var RequestPrimitive v_requestRetrive; + var PrimitiveContent v_primitiveContentResponse; + var integer v_ae1Index, v_contIndex, v_auxAcpIndex; + var DynAuthDasRequest v_dasRequest; + + //Test component configuration + f_cf01Up(); + + //Preamble (initial conditions) + v_auxAcpIndex := f_cse_preamble_createAcpAux( - , int61); + v_ae1Index := f_cse_preamble_registerAe(); + v_contIndex := f_cse_createResource_withAcpAux(int3, m_createContainerBase, v_ae1Index); + //TODO => ? and the IUT having registered at least one DAS AE + + //TestBody + v_requestRetrive.to_ := f_getResourceAddress(v_contIndex); + v_requestRetrive.from_ := f_getOriginator(v_ae1Index); + + v_primitiveContentResponse.responsePrimitive.to_ := f_getResourceAddress(v_contIndex); + v_primitiveContentResponse.responsePrimitive.from_ := f_getOriginator(v_ae1Index); + + v_dasRequest.originator := f_getOriginator(v_ae1Index); + v_dasRequest.targetedResourceType := int3; + v_dasRequest.operation := int2; + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int1, - , v_dasRequest); + + mcaPort.send(m_request(v_requestRetrive)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": DAS Request received successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong SecurityInfo (securityInfoType ¦¦ dasRequest ) Message received"); + } + [] mcaPort.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_deleteResources(); + f_cf01Down(); + } + } + + group ESCertKE { testcase TC_CSE_ESC_BV_001() runs on CseSimu system CseSystem { @@ -100,9 +168,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { 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("ClientHello"); - v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone")); + //Base 64 representation of message (https://www.base64encode.org/) ? ClientHello + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2xpZW50SGVsbG8="); + //msg ? ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("U2VydmVySGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU=")); mccPort.send(m_request(v_requestNotify)); tc_ac.start; @@ -128,8 +197,6 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { f_cf02DownCseSimuMaster(); } - - testcase TC_CSE_ESC_BV_002() runs on CseSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_requestNotify; @@ -150,9 +217,10 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 { 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")); + //TODO Base 64 representation of message ? Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished + v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Q2VydGlmaWNhdGUqLCBDbGllbnRLZXlFeGNoYW5nZSwgQ2VydGlmaWNhdGVWZXJpZnkqLCBbQ2hhbmdlQ2lwaGVyU3BlY10sIEZpbmlzaGVk"); + // Msg: ? [ChangeCipherSpec], Finished + v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("W0NoYW5nZUNpcGhlclNwZWNdLCBGaW5pc2hlZA==")); mccPort.send(m_request(v_requestNotify)); tc_ac.start; alt {