Loading branches/v3/ttcn/LibSip_Steps.ttcn +30 −71 Original line number Diff line number Diff line Loading @@ -136,7 +136,6 @@ module LibSip_Steps { ) return Credentials { var Credentials v_result; var charstring v_nonce := ""; // TODO STF471 change: different cnonce value, e.g. in register and de-register var charstring v_cnonce := int2str(float2int(int2float(13172657659 - 1317266) * rnd()) + 1317265); // RFC 2617 3.2.2 username: Loading @@ -154,6 +153,8 @@ module LibSip_Steps { // correct way would be to increase c_nonceCount depending on used nonce value // see RFC 2617, where it is stated, that nonce-count has to be incremented // every time UE uses the same nonce // SPEC: for every request with the same nonce used, nonce-count has to be incremented, // to detect request replay attacks const charstring cl_nonceCount := "00000001"; var charstring v_qop := p_userprofile.qop; var charstring v_uri := c_sipScheme & ":" & p_userprofile.registrarDomain; Loading @@ -175,7 +176,6 @@ module LibSip_Steps { v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // Construct credentials for an Authorization field of a request. // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := v_username } Loading Loading @@ -204,8 +204,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -214,20 +212,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } else { v_digestResponse[7] := { if (v_opaque != "") { v_digestResponse[9] := { id := "opaque", paramValue := { quotedString := v_opaque } }; // already enclosed to " characters v_digestResponse[8] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[9] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -288,7 +277,6 @@ module LibSip_Steps { // calculate a digest response for the Authorize header v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := v_username } Loading @@ -313,8 +301,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[6] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -323,20 +309,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } else { if (v_opaque == "") { v_digestResponse[6] := { id := "opaque", paramValue := { quotedString := v_opaque } }; // already enclosed to " characters v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[8] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -476,7 +453,6 @@ module LibSip_Steps { v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // Construct credentials for an Authorization field of a request. // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := "DifferentToPrivateUser" } Loading Loading @@ -505,8 +481,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -515,20 +489,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; } else { v_digestResponse[7] := { if (v_opaque != "") { v_digestResponse[9] := { id := "opaque", paramValue := { quotedString := "" } }; // already enclosed to " characters v_digestResponse[8] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[9] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -673,7 +638,6 @@ module LibSip_Steps { return v_result; } // TODO STF471 added, check location /** * @desc Return the updated component variable of via header * @return component variable of via header Loading Loading @@ -3148,7 +3112,6 @@ module LibSip_Steps { } } // end f_awaitingResponse // TODO STF471 addition /** * @desc Function waiting for a response, repeat if 100 Trying is received * @param p_Response expected response message Loading Loading @@ -3210,7 +3173,6 @@ module LibSip_Steps { } } // end f_awaitingResponsePassOnTimeout // TODO STF471 added /** * @desc Function waiting for a 200 OK response * @param p_cSeq_s current cSeq expectation Loading Loading @@ -3360,7 +3322,6 @@ module LibSip_Steps { f_awaitingACK_setHeaders(p_ACK, false); } // end f_awaitingACK // TODO STF471 added /** * @desc function awaiting ACK request */ Loading Loading @@ -4407,7 +4368,6 @@ module LibSip_Steps { f_awaitingACK(mw_ACK_Request_Base(vc_callId)); } // TODO STF471 added altstep a_receiveCANCELorNothing( in template(present) CANCEL_Request p_CANCEL := ? ) runs on SipComponent { Loading @@ -4419,7 +4379,6 @@ module LibSip_Steps { } } // TODO STF471 added altstep a_awaitNotify( in template(present) NOTIFY_Request p_MSG := ?, inout boolean p_receivedNotify Loading Loading
branches/v3/ttcn/LibSip_Steps.ttcn +30 −71 Original line number Diff line number Diff line Loading @@ -136,7 +136,6 @@ module LibSip_Steps { ) return Credentials { var Credentials v_result; var charstring v_nonce := ""; // TODO STF471 change: different cnonce value, e.g. in register and de-register var charstring v_cnonce := int2str(float2int(int2float(13172657659 - 1317266) * rnd()) + 1317265); // RFC 2617 3.2.2 username: Loading @@ -154,6 +153,8 @@ module LibSip_Steps { // correct way would be to increase c_nonceCount depending on used nonce value // see RFC 2617, where it is stated, that nonce-count has to be incremented // every time UE uses the same nonce // SPEC: for every request with the same nonce used, nonce-count has to be incremented, // to detect request replay attacks const charstring cl_nonceCount := "00000001"; var charstring v_qop := p_userprofile.qop; var charstring v_uri := c_sipScheme & ":" & p_userprofile.registrarDomain; Loading @@ -175,7 +176,6 @@ module LibSip_Steps { v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // Construct credentials for an Authorization field of a request. // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := v_username } Loading Loading @@ -204,8 +204,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -214,20 +212,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } else { v_digestResponse[7] := { if (v_opaque != "") { v_digestResponse[9] := { id := "opaque", paramValue := { quotedString := v_opaque } }; // already enclosed to " characters v_digestResponse[8] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[9] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -288,7 +277,6 @@ module LibSip_Steps { // calculate a digest response for the Authorize header v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := v_username } Loading @@ -313,8 +301,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[6] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -323,20 +309,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } else { if (v_opaque == "") { v_digestResponse[6] := { id := "opaque", paramValue := { quotedString := v_opaque } }; // already enclosed to " characters v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[8] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; // nonceCount } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -476,7 +453,6 @@ module LibSip_Steps { v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity); // Construct credentials for an Authorization field of a request. // TODO STF471 change: avoid setting absent opaque value v_digestResponse[0] := { id := "username", paramValue := { quotedString := "DifferentToPrivateUser" } Loading Loading @@ -505,8 +481,6 @@ module LibSip_Steps { id := "cnonce", paramValue := { quotedString := v_cnonce } }; if (v_opaque == "") { v_digestResponse[7] := { id := "qop", paramValue := { tokenOrHost := v_qop } Loading @@ -515,20 +489,11 @@ module LibSip_Steps { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; } else { v_digestResponse[7] := { if (v_opaque != "") { v_digestResponse[9] := { id := "opaque", paramValue := { quotedString := "" } }; // already enclosed to " characters v_digestResponse[8] := { id := "qop", paramValue := { tokenOrHost := v_qop } }; // qop v_digestResponse[9] := { id := "nc", paramValue := { tokenOrHost := cl_nonceCount } }; } v_result := {digestResponse := v_digestResponse}; Loading Loading @@ -673,7 +638,6 @@ module LibSip_Steps { return v_result; } // TODO STF471 added, check location /** * @desc Return the updated component variable of via header * @return component variable of via header Loading Loading @@ -3148,7 +3112,6 @@ module LibSip_Steps { } } // end f_awaitingResponse // TODO STF471 addition /** * @desc Function waiting for a response, repeat if 100 Trying is received * @param p_Response expected response message Loading Loading @@ -3210,7 +3173,6 @@ module LibSip_Steps { } } // end f_awaitingResponsePassOnTimeout // TODO STF471 added /** * @desc Function waiting for a 200 OK response * @param p_cSeq_s current cSeq expectation Loading Loading @@ -3360,7 +3322,6 @@ module LibSip_Steps { f_awaitingACK_setHeaders(p_ACK, false); } // end f_awaitingACK // TODO STF471 added /** * @desc function awaiting ACK request */ Loading Loading @@ -4407,7 +4368,6 @@ module LibSip_Steps { f_awaitingACK(mw_ACK_Request_Base(vc_callId)); } // TODO STF471 added altstep a_receiveCANCELorNothing( in template(present) CANCEL_Request p_CANCEL := ? ) runs on SipComponent { Loading @@ -4419,7 +4379,6 @@ module LibSip_Steps { } } // TODO STF471 added altstep a_awaitNotify( in template(present) NOTIFY_Request p_MSG := ?, inout boolean p_receivedNotify Loading