Loading ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_Functions.ttcn +198 −4 Original line number Original line Diff line number Diff line Loading @@ -519,6 +519,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_SA_INIT request * @desc Test Node waits for IKE_SA_INIT request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeSaInitReq( in template Ipv6Address p_addrTn, function f_waitForIkeSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrIut, Loading Loading @@ -781,6 +783,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_AUTH request * @desc Test Node waits for IKE_AUTH request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_waitForIkeAuthReq( in template Ipv6Address p_addrTn, function f_waitForIkeAuthReq( in template Ipv6Address p_addrTn, Loading Loading @@ -1101,6 +1105,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request * @desc Test Node waits for CREATE_CHILD_SA request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaReq( in template Ipv6Address p_addrTn, function f_waitForCreateChildSaReq( in template Ipv6Address p_addrTn, Loading Loading @@ -1157,6 +1163,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying an SA * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying an SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -1235,6 +1243,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying the IKE_SA * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying the IKE_SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaReqRekeyIke( in template Ipv6Address p_addrTn, function f_waitForCreateChildSaReqRekeyIke( in template Ipv6Address p_addrTn, Loading Loading @@ -1299,6 +1309,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for INFORMATIONAL request with specific payload * @desc Test Node waits for INFORMATIONAL request with specific payload * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_IkePayloadList list of payloads to be received * @param p_IkePayloadList list of payloads to be received */ */ Loading Loading @@ -1354,6 +1366,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for INFORMATIONAL request with any or no payload * @desc Test Node waits for INFORMATIONAL request with any or no payload * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForInformationalReq_Any( in template Ipv6Address p_addrTn, function f_waitForInformationalReq_Any( in template Ipv6Address p_addrTn, Loading Loading @@ -1411,6 +1425,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_SA_INIT response * @desc Test Node waits for IKE_SA_INIT response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeSaInitRsp( function f_waitForIkeSaInitRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -1571,7 +1587,7 @@ module LibIpv6_Rfc4306Ikev2_Functions { } } // A unexpected IKE_SA_INIT response with a Notify payload is received // An unexpected IKE_SA_INIT response with a Notify payload is received [] ipPort.receive(mw_ikeSaInitRsp( v_ikeSrc, [] ipPort.receive(mw_ikeSaInitRsp( v_ikeSrc, v_ikeDst, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpIutPort, Loading Loading @@ -1759,6 +1775,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_AUTH response * @desc Test Node waits for IKE_AUTH response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeAuthRsp( function f_waitForIkeAuthRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2004,6 +2022,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA response * @desc Test Node waits for CREATE_CHILD_SA response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaRsp( function f_waitForCreateChildSaRsp( Loading Loading @@ -2114,10 +2134,102 @@ module LibIpv6_Rfc4306Ikev2_Functions { return v_ret; return v_ret; } // end f_waitForCreateChildSaRsp } // end f_waitForCreateChildSaRsp /* * @desc Test Node waits for CREATE_CHILD_SA response, parameter list is parametrized * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ function f_waitForCreateChildSaRsp_ParamPLL( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrTunnelStart, in template Ipv6Address p_addrTunnelEnd, UInt8 p_iFlag, template IkePayloadList p_ikePayloadList ) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret := e_success; var FncRetCode v_ret_local; var Ipv6Packet v_ipv6Packet; // next payload from IKE header var UInt8 v_nextPayload; // list of payloads var IkePayloadList v_ikePayloadList; var IkePayload v_ikePayload; var Ipv6Address v_ikeSrc; var Ipv6Address v_ikeDst; if(vc_sad[c_saIni].ipSecProtocolMode == e_transportMode) { v_ikeSrc := valueof(p_addrIut); v_ikeDst := valueof(p_addrTn); } else { v_ikeSrc := valueof(p_addrTunnelEnd); v_ikeDst := valueof(p_addrTunnelStart); } tc_wait.start; alt { [] ipPort.receive(mw_createChildSaRsp( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID, mw_encryptedPLL(p_ikePayloadList))) -> value v_ipv6Packet { tc_wait.stop; } // A unexpected CREATE_CHILD_SA response with an unexpected Notify payload is received [] ipPort.receive(mw_createChildSaRsp( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID, mw_encryptedPLL(mw_createChildSaRsp_Notify))) -> value v_ipv6Packet { tc_wait.stop; v_nextPayload := v_ipv6Packet.ipv6Payload.ikeMsg.payloadList[0].encrypted.nextPayload; v_ikePayloadList := v_ipv6Packet.ipv6Payload.ikeMsg.payloadList[0].encrypted.payloadList; // get Notify payload data v_ret_local := f_getPayload(v_ikePayloadList,v_nextPayload,c_notifyPL,v_ikePayload); if (v_ret_local == e_success) { log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: CREATE_CHILD_SA response with unexpected Notify payload received, error/status value = ",v_ikePayload.notify.notifyMessageType," **** "); v_ret := e_error;} else { log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: Unexpected CREATE_CHILD_SA response received **** "); v_ret := e_error;} return v_ret; } [] tc_wait.timeout { v_ret := e_timeout; log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: tc_wait.timeout **** "); return v_ret; } } // end alt return v_ret; } // end f_waitForCreateChildSaRsp_ParamPLL /* /* * @desc Test Node waits for INFORMATIONAL responset * @desc Test Node waits for INFORMATIONAL responset * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_IkePayloadList list of payloads to be received * @param p_IkePayloadList list of payloads to be received */ */ Loading Loading @@ -2169,6 +2281,60 @@ module LibIpv6_Rfc4306Ikev2_Functions { return v_ret; return v_ret; } // end f_waitForInformationalRsp } // end f_waitForInformationalRsp /* * @desc Test Node waits for INFORMATIONAL response with any or no payload * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ function f_waitForInformationalRsp_Any( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrTunnelStart, in template Ipv6Address p_addrTunnelEnd, UInt1 p_iFlag) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret := e_success; var Ipv6Address v_ikeSrc; var Ipv6Address v_ikeDst; if(vc_sad[c_saIni].ipSecProtocolMode == e_transportMode) { v_ikeSrc := valueof(p_addrIut); v_ikeDst := valueof(p_addrTn); } else { v_ikeSrc := valueof(p_addrTunnelEnd); v_ikeDst := valueof(p_addrTunnelStart); } tc_wait.start; alt { [] ipPort.receive(mw_informationalRsp_Any( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID)) { tc_wait.stop; vc_ikeSad[0].messageID := vc_ikeSad[0].messageID + 1; } [] tc_wait.timeout { v_ret := e_timeout; log("**** f_waitForInformationalRsp: ERROR: tc_wait.timeout **** "); } } // end alt return v_ret; } // end f_waitForInformationalRsp } // end group receiveResponses } // end group receiveResponses group sendRequests { group sendRequests { Loading Loading @@ -2278,6 +2444,8 @@ group sendRequests { * @desc Test Node builds IKE_SA_INIT request * @desc Test Node builds IKE_SA_INIT request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createSaInitReq( function f_createSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2417,6 +2585,8 @@ group sendRequests { * @desc Test Node builds IKE_SA_INIT request and sends * @desc Test Node builds IKE_SA_INIT request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createAndSendSaInitReq( function f_createAndSendSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2673,6 +2843,8 @@ group sendRequests { * @desc Test Node builds IKE_AUTH request * @desc Test Node builds IKE_AUTH request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createIkeAuthReq( function f_createIkeAuthReq( Loading Loading @@ -2930,6 +3102,8 @@ group sendRequests { * @desc Test Node builds IKE_AUTH request and sends * @desc Test Node builds IKE_AUTH request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createAndSendIkeAuthReq( function f_createAndSendIkeAuthReq( Loading Loading @@ -3176,6 +3350,8 @@ group sendRequests { * @desc Test Node builds CREATE_CHILD_SA request * @desc Test Node builds CREATE_CHILD_SA request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -3392,8 +3568,8 @@ group sendRequests { } // end f_createChildSaReq } // end f_createChildSaReq /* /* * @desc Test Node sends IKE_AUTH request * @desc Test Node sends CREATE_CHILD_SA request * @param p_ikeAuthRequest IKE_AUTH request to be sent * @param p_createChildSaReq CREATE_CHILD_SA request to be sent */ */ function f_sendCreateChildSaReq(in template CreateChildSaRequest p_createChildSaReq) function f_sendCreateChildSaReq(in template CreateChildSaRequest p_createChildSaReq) runs on LibIpv6Node runs on LibIpv6Node Loading Loading @@ -3421,6 +3597,8 @@ group sendRequests { * @desc Test Node builds CREATE_CHILD_SA request and sends * @desc Test Node builds CREATE_CHILD_SA request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -3506,6 +3684,8 @@ group sendRequests { * @desc Test Node builds INFORMATIONAL request * @desc Test Node builds INFORMATIONAL request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request Loading Loading @@ -3587,6 +3767,8 @@ group sendRequests { * @desc Test Node builds INFORMATIONAL request and sends * @desc Test Node builds INFORMATIONAL request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request Loading Loading @@ -3633,6 +3815,8 @@ group sendResponses { * @desc Test Node builds IKE_SA_INIT response * @desc Test Node builds IKE_SA_INIT response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createAndSendSaInitRsp( function f_createAndSendSaInitRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -3775,6 +3959,8 @@ group sendResponses { * @desc Test Node builds IKE_AUTH response * @desc Test Node builds IKE_AUTH response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createAndSendAuthRsp( function f_createAndSendAuthRsp( Loading Loading @@ -4012,6 +4198,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response * @desc Test Node builds CREATE_CHILD_SA response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4345,6 +4533,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response for rekeying an SA * @desc Test Node builds CREATE_CHILD_SA response for rekeying an SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4708,6 +4898,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response for rekeying the IKE_SA * @desc Test Node builds CREATE_CHILD_SA response for rekeying the IKE_SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4850,6 +5042,8 @@ group sendResponses { * @desc Test Node builds INFORMATIONAL response * @desc Test Node builds INFORMATIONAL response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL response * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL response * @param p_payload template of payload to be sent in INFORMATIONAL response * @param p_payload template of payload to be sent in INFORMATIONAL response Loading ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_Templates.ttcn +183 −1 Original line number Original line Diff line number Diff line Loading @@ -155,6 +155,41 @@ }} }} } } template IkeSaInitResponse mw_ikeSaInitRsp_IKEv1 ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := ?, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := ?, exchangeType := c_ikeSaInit, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := c_iFlagResponder, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template IkeSaInitResponse m_ikeSaInitRsp ( template Ipv6Address p_src, template IkeSaInitResponse m_ikeSaInitRsp ( template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -334,6 +369,42 @@ }} }} } } template IkeAuthResponse mw_ikeAuthRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpdestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpsourcePort, destPort := p_udpdestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_ikeAuth, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := c_iFlagResponder, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template IkeAuthResponse m_ikeAuthRsp ( template Ipv6Address p_src, template IkeAuthResponse m_ikeAuthRsp ( template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -533,6 +604,43 @@ }} }} } } template CreateChildSaResponse mw_createChildSaRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_createChildSa, twoXFlags := ?, rFlag := c_rFlagRequest, vFlag := c_vFlagSet, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template CreateChildSaResponse m_createChildSaRsp (template Ipv6Address p_src, template CreateChildSaResponse m_createChildSaRsp (template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -735,6 +843,80 @@ }} }} } } template InformationalResponse mw_informationalRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, //IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_informational, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template InformationalResponse mw_informationalRsp_Any (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := c_ikeMajorVersion2, minorVersion := c_ikeMinorVersion0, exchangeType := c_informational, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlag, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template InformationalResponse m_informationalRsp (template Ipv6Address p_src, template InformationalResponse m_informationalRsp (template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_TypesAndValues.ttcn +1 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,7 @@ const UInt1 c_rFlagRequest := 0; const UInt1 c_rFlagRequest := 0; const UInt1 c_rFlagResponse := 1; const UInt1 c_rFlagResponse := 1; const UInt1 c_vFlag := 0; const UInt1 c_vFlag := 0; const UInt1 c_vFlagSet := 1; const UInt1 c_iFlagResponder := 0; const UInt1 c_iFlagResponder := 0; const UInt1 c_iFlagInitiator := 1; const UInt1 c_iFlagInitiator := 1; } // end group IkeRfc4306FlagsTypes } // end group IkeRfc4306FlagsTypes Loading Loading
ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_Functions.ttcn +198 −4 Original line number Original line Diff line number Diff line Loading @@ -519,6 +519,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_SA_INIT request * @desc Test Node waits for IKE_SA_INIT request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeSaInitReq( in template Ipv6Address p_addrTn, function f_waitForIkeSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrIut, Loading Loading @@ -781,6 +783,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_AUTH request * @desc Test Node waits for IKE_AUTH request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_waitForIkeAuthReq( in template Ipv6Address p_addrTn, function f_waitForIkeAuthReq( in template Ipv6Address p_addrTn, Loading Loading @@ -1101,6 +1105,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request * @desc Test Node waits for CREATE_CHILD_SA request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaReq( in template Ipv6Address p_addrTn, function f_waitForCreateChildSaReq( in template Ipv6Address p_addrTn, Loading Loading @@ -1157,6 +1163,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying an SA * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying an SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -1235,6 +1243,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying the IKE_SA * @desc Test Node waits for CREATE_CHILD_SA request ued for rekeying the IKE_SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaReqRekeyIke( in template Ipv6Address p_addrTn, function f_waitForCreateChildSaReqRekeyIke( in template Ipv6Address p_addrTn, Loading Loading @@ -1299,6 +1309,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for INFORMATIONAL request with specific payload * @desc Test Node waits for INFORMATIONAL request with specific payload * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_IkePayloadList list of payloads to be received * @param p_IkePayloadList list of payloads to be received */ */ Loading Loading @@ -1354,6 +1366,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for INFORMATIONAL request with any or no payload * @desc Test Node waits for INFORMATIONAL request with any or no payload * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForInformationalReq_Any( in template Ipv6Address p_addrTn, function f_waitForInformationalReq_Any( in template Ipv6Address p_addrTn, Loading Loading @@ -1411,6 +1425,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_SA_INIT response * @desc Test Node waits for IKE_SA_INIT response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeSaInitRsp( function f_waitForIkeSaInitRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -1571,7 +1587,7 @@ module LibIpv6_Rfc4306Ikev2_Functions { } } // A unexpected IKE_SA_INIT response with a Notify payload is received // An unexpected IKE_SA_INIT response with a Notify payload is received [] ipPort.receive(mw_ikeSaInitRsp( v_ikeSrc, [] ipPort.receive(mw_ikeSaInitRsp( v_ikeSrc, v_ikeDst, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpIutPort, Loading Loading @@ -1759,6 +1775,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for IKE_AUTH response * @desc Test Node waits for IKE_AUTH response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_waitForIkeAuthRsp( function f_waitForIkeAuthRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2004,6 +2022,8 @@ module LibIpv6_Rfc4306Ikev2_Functions { * @desc Test Node waits for CREATE_CHILD_SA response * @desc Test Node waits for CREATE_CHILD_SA response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ */ function f_waitForCreateChildSaRsp( function f_waitForCreateChildSaRsp( Loading Loading @@ -2114,10 +2134,102 @@ module LibIpv6_Rfc4306Ikev2_Functions { return v_ret; return v_ret; } // end f_waitForCreateChildSaRsp } // end f_waitForCreateChildSaRsp /* * @desc Test Node waits for CREATE_CHILD_SA response, parameter list is parametrized * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ function f_waitForCreateChildSaRsp_ParamPLL( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrTunnelStart, in template Ipv6Address p_addrTunnelEnd, UInt8 p_iFlag, template IkePayloadList p_ikePayloadList ) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret := e_success; var FncRetCode v_ret_local; var Ipv6Packet v_ipv6Packet; // next payload from IKE header var UInt8 v_nextPayload; // list of payloads var IkePayloadList v_ikePayloadList; var IkePayload v_ikePayload; var Ipv6Address v_ikeSrc; var Ipv6Address v_ikeDst; if(vc_sad[c_saIni].ipSecProtocolMode == e_transportMode) { v_ikeSrc := valueof(p_addrIut); v_ikeDst := valueof(p_addrTn); } else { v_ikeSrc := valueof(p_addrTunnelEnd); v_ikeDst := valueof(p_addrTunnelStart); } tc_wait.start; alt { [] ipPort.receive(mw_createChildSaRsp( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID, mw_encryptedPLL(p_ikePayloadList))) -> value v_ipv6Packet { tc_wait.stop; } // A unexpected CREATE_CHILD_SA response with an unexpected Notify payload is received [] ipPort.receive(mw_createChildSaRsp( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID, mw_encryptedPLL(mw_createChildSaRsp_Notify))) -> value v_ipv6Packet { tc_wait.stop; v_nextPayload := v_ipv6Packet.ipv6Payload.ikeMsg.payloadList[0].encrypted.nextPayload; v_ikePayloadList := v_ipv6Packet.ipv6Payload.ikeMsg.payloadList[0].encrypted.payloadList; // get Notify payload data v_ret_local := f_getPayload(v_ikePayloadList,v_nextPayload,c_notifyPL,v_ikePayload); if (v_ret_local == e_success) { log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: CREATE_CHILD_SA response with unexpected Notify payload received, error/status value = ",v_ikePayload.notify.notifyMessageType," **** "); v_ret := e_error;} else { log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: Unexpected CREATE_CHILD_SA response received **** "); v_ret := e_error;} return v_ret; } [] tc_wait.timeout { v_ret := e_timeout; log("**** f_waitForCreateChildSaRsp_ParamPLL: ERROR: tc_wait.timeout **** "); return v_ret; } } // end alt return v_ret; } // end f_waitForCreateChildSaRsp_ParamPLL /* /* * @desc Test Node waits for INFORMATIONAL responset * @desc Test Node waits for INFORMATIONAL responset * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder * @param p_IkePayloadList list of payloads to be received * @param p_IkePayloadList list of payloads to be received */ */ Loading Loading @@ -2169,6 +2281,60 @@ module LibIpv6_Rfc4306Ikev2_Functions { return v_ret; return v_ret; } // end f_waitForInformationalRsp } // end f_waitForInformationalRsp /* * @desc Test Node waits for INFORMATIONAL response with any or no payload * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag IKEv2 flag IKEv2 header indicating initiator or responder */ function f_waitForInformationalRsp_Any( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrIut, in template Ipv6Address p_addrTunnelStart, in template Ipv6Address p_addrTunnelEnd, UInt1 p_iFlag) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret := e_success; var Ipv6Address v_ikeSrc; var Ipv6Address v_ikeDst; if(vc_sad[c_saIni].ipSecProtocolMode == e_transportMode) { v_ikeSrc := valueof(p_addrIut); v_ikeDst := valueof(p_addrTn); } else { v_ikeSrc := valueof(p_addrTunnelEnd); v_ikeDst := valueof(p_addrTunnelStart); } tc_wait.start; alt { [] ipPort.receive(mw_informationalRsp_Any( v_ikeSrc, v_ikeDst, vc_ikeSad[0].udpIutPort, vc_ikeSad[0].udpTnPort, vc_ikeSad[0].spiInitiator, vc_ikeSad[0].spiResponder, p_iFlag, vc_ikeSad[0].messageID)) { tc_wait.stop; vc_ikeSad[0].messageID := vc_ikeSad[0].messageID + 1; } [] tc_wait.timeout { v_ret := e_timeout; log("**** f_waitForInformationalRsp: ERROR: tc_wait.timeout **** "); } } // end alt return v_ret; } // end f_waitForInformationalRsp } // end group receiveResponses } // end group receiveResponses group sendRequests { group sendRequests { Loading Loading @@ -2278,6 +2444,8 @@ group sendRequests { * @desc Test Node builds IKE_SA_INIT request * @desc Test Node builds IKE_SA_INIT request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createSaInitReq( function f_createSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2417,6 +2585,8 @@ group sendRequests { * @desc Test Node builds IKE_SA_INIT request and sends * @desc Test Node builds IKE_SA_INIT request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createAndSendSaInitReq( function f_createAndSendSaInitReq( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -2673,6 +2843,8 @@ group sendRequests { * @desc Test Node builds IKE_AUTH request * @desc Test Node builds IKE_AUTH request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createIkeAuthReq( function f_createIkeAuthReq( Loading Loading @@ -2930,6 +3102,8 @@ group sendRequests { * @desc Test Node builds IKE_AUTH request and sends * @desc Test Node builds IKE_AUTH request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createAndSendIkeAuthReq( function f_createAndSendIkeAuthReq( Loading Loading @@ -3176,6 +3350,8 @@ group sendRequests { * @desc Test Node builds CREATE_CHILD_SA request * @desc Test Node builds CREATE_CHILD_SA request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -3392,8 +3568,8 @@ group sendRequests { } // end f_createChildSaReq } // end f_createChildSaReq /* /* * @desc Test Node sends IKE_AUTH request * @desc Test Node sends CREATE_CHILD_SA request * @param p_ikeAuthRequest IKE_AUTH request to be sent * @param p_createChildSaReq CREATE_CHILD_SA request to be sent */ */ function f_sendCreateChildSaReq(in template CreateChildSaRequest p_createChildSaReq) function f_sendCreateChildSaReq(in template CreateChildSaRequest p_createChildSaReq) runs on LibIpv6Node runs on LibIpv6Node Loading Loading @@ -3421,6 +3597,8 @@ group sendRequests { * @desc Test Node builds CREATE_CHILD_SA request and sends * @desc Test Node builds CREATE_CHILD_SA request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -3506,6 +3684,8 @@ group sendRequests { * @desc Test Node builds INFORMATIONAL request * @desc Test Node builds INFORMATIONAL request * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request Loading Loading @@ -3587,6 +3767,8 @@ group sendRequests { * @desc Test Node builds INFORMATIONAL request and sends * @desc Test Node builds INFORMATIONAL request and sends * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request * @param p_payload template of payload to be sent in INFORMATIONAL request Loading Loading @@ -3633,6 +3815,8 @@ group sendResponses { * @desc Test Node builds IKE_SA_INIT response * @desc Test Node builds IKE_SA_INIT response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point */ */ function f_createAndSendSaInitRsp( function f_createAndSendSaInitRsp( in template Ipv6Address p_addrTn, in template Ipv6Address p_addrTn, Loading Loading @@ -3775,6 +3959,8 @@ group sendResponses { * @desc Test Node builds IKE_AUTH response * @desc Test Node builds IKE_AUTH response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ function f_createAndSendAuthRsp( function f_createAndSendAuthRsp( Loading Loading @@ -4012,6 +4198,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response * @desc Test Node builds CREATE_CHILD_SA response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4345,6 +4533,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response for rekeying an SA * @desc Test Node builds CREATE_CHILD_SA response for rekeying an SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4708,6 +4898,8 @@ group sendResponses { * @desc Test Node builds CREATE_CHILD_SA response for rekeying the IKE_SA * @desc Test Node builds CREATE_CHILD_SA response for rekeying the IKE_SA * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_protocolId chosen security protocol, AH or ESP * @param p_protocolId chosen security protocol, AH or ESP */ */ Loading Loading @@ -4850,6 +5042,8 @@ group sendResponses { * @desc Test Node builds INFORMATIONAL response * @desc Test Node builds INFORMATIONAL response * @param p_addrIut address of IUT * @param p_addrIut address of IUT * @param p_addrTn address of test node * @param p_addrTn address of test node * @param p_addrTunnelStart address of tunnel start point * @param p_addrTunnelEnd address of tunnel end point * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_iFlag i flag IKEv2 header indicating initiator or responder * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL response * @param p_nextPayload payload type of payload to be sent in INFORMATIONAL response * @param p_payload template of payload to be sent in INFORMATIONAL response * @param p_payload template of payload to be sent in INFORMATIONAL response Loading
ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_Templates.ttcn +183 −1 Original line number Original line Diff line number Diff line Loading @@ -155,6 +155,41 @@ }} }} } } template IkeSaInitResponse mw_ikeSaInitRsp_IKEv1 ( template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := ?, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := ?, exchangeType := c_ikeSaInit, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := c_iFlagResponder, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template IkeSaInitResponse m_ikeSaInitRsp ( template Ipv6Address p_src, template IkeSaInitResponse m_ikeSaInitRsp ( template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -334,6 +369,42 @@ }} }} } } template IkeAuthResponse mw_ikeAuthRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpdestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpsourcePort, destPort := p_udpdestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_ikeAuth, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := c_iFlagResponder, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template IkeAuthResponse m_ikeAuthRsp ( template Ipv6Address p_src, template IkeAuthResponse m_ikeAuthRsp ( template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -533,6 +604,43 @@ }} }} } } template CreateChildSaResponse mw_createChildSaRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, // IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_createChildSa, twoXFlags := ?, rFlag := c_rFlagRequest, vFlag := c_vFlagSet, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template CreateChildSaResponse m_createChildSaRsp (template Ipv6Address p_src, template CreateChildSaResponse m_createChildSaRsp (template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading Loading @@ -735,6 +843,80 @@ }} }} } } template InformationalResponse mw_informationalRsp_IKEv1 (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := 1, //IKEv1 minorVersion := c_ikeMinorVersion0, exchangeType := c_informational, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlagSet, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template InformationalResponse mw_informationalRsp_Any (template Ipv6Address p_src, template Ipv6Address p_dst, UInt16 p_udpSourcePort, UInt16 p_udpDestPort, Oct8 p_initiatorSpi, Oct8 p_responderSpi, UInt1 p_iFlag, UInt32 p_messageID) := { ipv6Hdr := mw_ipHdr_nextHdr_srcDst(c_udpHdr, p_src, p_dst), extHdrList := omit, ipv6Payload := { ikeMsg := { sourcePort := p_udpSourcePort, destPort := p_udpDestPort, msgLength := ?, checksum := ?, padding := c_4ZeroBytes ifpresent, // IKEv2 Header ikev2Header := { initiatorSpi := p_initiatorSpi, responderSpi := p_responderSpi, nextPayload := ?, majorVersion := c_ikeMajorVersion2, minorVersion := c_ikeMinorVersion0, exchangeType := c_informational, twoXFlags := ?, rFlag := c_rFlagResponse, vFlag := c_vFlag, iFlag := p_iFlag, threeXFlags := ?, messageID := p_messageID, messageLength := ? }, // IKEv2 Payloads payloadList := ? }} } template InformationalResponse m_informationalRsp (template Ipv6Address p_src, template InformationalResponse m_informationalRsp (template Ipv6Address p_src, template Ipv6Address p_dst, template Ipv6Address p_dst, UInt16 p_udpsourcePort, UInt16 p_udpsourcePort, Loading
ttcn3/EtsiLibrary/LibIpv6/LibSec/LibIpv6_Rfc4306Ikev2_TypesAndValues.ttcn +1 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,7 @@ const UInt1 c_rFlagRequest := 0; const UInt1 c_rFlagRequest := 0; const UInt1 c_rFlagResponse := 1; const UInt1 c_rFlagResponse := 1; const UInt1 c_vFlag := 0; const UInt1 c_vFlag := 0; const UInt1 c_vFlagSet := 1; const UInt1 c_iFlagResponder := 0; const UInt1 c_iFlagResponder := 0; const UInt1 c_iFlagInitiator := 1; const UInt1 c_iFlagInitiator := 1; } // end group IkeRfc4306FlagsTypes } // end group IkeRfc4306FlagsTypes Loading