Commit 7163b8b5 authored by pintar's avatar pintar
Browse files

corrections due to validation of STF346 from week 46

parent 5ed9f020
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ module LibSip_Interface language "TTCN-3:2005"//MRO
	  var boolean 		vc_MESSAGEreceived 		:= false; 	// true if MESSAGE received during altstep
	  var boolean 		vc_first_recv			:= false; 	// true after receipt of first incomming SIP message
	  var boolean 		vc_firstREGISTER_sent	:= false; 	// true after sent of first REGISTER message

  	  var boolean		vc_DeregDone 			:= false;	// true after first DeREGISTRATION trail (avoid loop)
	  var boolean v_white_space := false;//MRO

	  // ETS address
+4 −1
Original line number Diff line number Diff line
@@ -159,6 +159,8 @@ group SimpleConstants

	  const GenericParam c_Integrity_protected_yes := {"integrity-protected","yes"}
	  const GenericParam c_Integrity_protected_no := {"integrity-protected","no"}
	  const GenericParam c_Integrity_protected_ip_assoc_pending := {"integrity-protected","ip-assoc-pending"}
		

} //end group SimpleConstants

@@ -167,7 +169,8 @@ group AuthorizationConstants {
	const charstring c_ik := "";
	const charstring c_ck := "";
	const charstring c_algorithm := "MD5";
	const charstring c_nonce := ""
	const charstring c_nonce := "";
	const charstring c_nonce_value := "0edff6c521cc3f407f2d9e01cf6ed82b";

} //end group AuthorizationConstants

+74 −117
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ group ParameterOperations {
	  {
		digestResponse :=
		{
		  { id := "Digest username", paramValue := v_username },
		  { id := "username", paramValue := v_username },
		  { id := "realm", paramValue := v_realm },
		  { id := "uri", paramValue := v_uri },
		  { id := "nonce=""""", paramValue := omit }, // already enclosed to " characters
@@ -181,7 +181,7 @@ group ParameterOperations {
	  {
		digestResponse :=
		{
		  { id := "Digest username", paramValue := v_username },
		  { id := "username", paramValue := v_username },
		  { id := "realm", paramValue := v_realm },
		  { id := "nonce", paramValue := v_nonce },
		  { id := "uri", paramValue := v_uri },
@@ -270,7 +270,7 @@ group ParameterOperations {
	  {
		digestResponse :=
		{
		  { id := "Digest username", paramValue := v_username },
		  { id := "username", paramValue := v_username },
		  { id := "realm", paramValue := v_realm },
		  { id := "nonce", paramValue := v_nonce },
		  { id := "uri", paramValue := v_uri },
@@ -286,6 +286,25 @@ group ParameterOperations {
	  return v_result;
	}
	
	/**
		* 
		* @desc  Function to calculate credentials for response 401 - WWW-Authorization
		* @param p_qop of the peer UE (alternatively )
		* @param p_authorization parameter from 1st REGISTER request
		* @return Credentials field
		* @verdict 
		*/
	function f_calculatecChallenge_forWWWAuthorizationBody(in charstring p_qop, in Authorization p_authorization) return Challenge
	{ 
			var CommaParam_List v_challenge;
	  
			if (ischosen(p_authorization.body[0].digestResponse))
				{v_challenge := p_authorization.body[0].digestResponse}
				else {v_challenge := p_authorization.body[0].otherResponse.authParams};
      
			return (f_calculatecChallenge_forWWWAuthorization(p_qop,v_challenge));
	}
	
	/**
	 * 
	 * @desc  Function to calculate credentials for response 401 - WWW-Authorization
@@ -309,12 +328,12 @@ group ParameterOperations {
	  {
		digestCln :=
		{
		  { id := "Digest realm", paramValue := v_realm },
		  { id := "nonce=", paramValue := c_nonce },
		  { id := "algorithm=", paramValue := c_algorithm }, // algorithm is not enclosed to " characters
		  { id := "ck=", paramValue := c_ck },
		  { id := "ik=", paramValue := c_ik }, // already enclosed to " characters
		  { id := "qop="&v_qop, paramValue := omit }//qop
		  { id := "realm", paramValue := v_realm },
		  { id := "nonce", paramValue := "0edff6c521cc3f407f2d9e01cf6ed82b"},
		  { id := "algorithm", paramValue := c_algorithm }, // algorithm is not enclosed with " characters
		  { id := "ck", paramValue := "00112233445566778899aabbccddeeff" },
		  { id := "ik", paramValue := "ffeeddccbbaa99887766554433221100" }, // already enclosed to " characters
		  { id := "qop=\""&v_qop&"\"", paramValue := omit }//qop

		}
	  };
@@ -395,7 +414,7 @@ group ParameterOperations {
	 {
	   digestResponse :=
	   {
		 { id := "Digest username", paramValue := "DifferentToPrivateUser"},
		 { id := "username", paramValue := "DifferentToPrivateUser"},
		 { id := "realm", paramValue := v_realm },
		 { id := "nonce", paramValue := v_nonce },
		 { id := "uri", paramValue := v_uri },
@@ -1013,9 +1032,14 @@ group SetHeaders {
	 */
	function f_setHeadersCANCEL(inout CSeq p_cSeq_s) runs on SipComponent
	{      
	  f_setHeadersGeneral(p_cSeq_s, "CANCEL"); // cseq, contact, branch, via

	}// end function f_setHeadersBYE
		p_cSeq_s.method := "CANCEL"; 
		vc_branch := c_branchCookie & f_getRndTag();
		vc_via:={
    				fieldName := VIA_E,
    				viaBody 	 := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile))}
		};		
	}// end function f_setHeadersCANCEL

	/**
	 * 
@@ -1407,6 +1431,10 @@ group SetHeaders {
		addressField := vc_caller_To.addressField,
		fromParams := vc_caller_To.toParams};

	  if (ispresent(p_Request.msgHeader.authorization)) {
		vc_authorization := p_Request.msgHeader.authorization;
	    };
      
	} // end f_setHeadersOnReceiptOfREGISTER

	/**
@@ -2424,11 +2452,6 @@ group AwaitingMessage {
	  tc_wait.start(PX_SIP_TWAIT);
	  alt
	  {
		[] SIPP.receive	
		  {
			tc_wait.stop;
			setverdict(fail);
		  }
		[] tc_wait.timeout
		  {
			setverdict (pass);
@@ -2456,6 +2479,7 @@ group AwaitingMessage {
          [] tc_resp.timeout
            {
              setverdict (fail);
			  f_componentStop();               
            }
		}		
	}
@@ -2477,10 +2501,6 @@ group AwaitingMessage {
			  tc_resp.stop;
			  f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}		
	}
	
@@ -2508,6 +2528,7 @@ group AwaitingMessage {
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			  f_componentStop(); 
			}
		}		
	}
@@ -2530,10 +2551,6 @@ group AwaitingMessage {
			f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
			setverdict(pass)
		  }
		[] tc_ack.timeout
		  {
			setverdict (fail);
		  }
  	}
	} //end awaitingOkResponse

@@ -2553,10 +2570,6 @@ group AwaitingMessage {
			f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
			setverdict(pass)
		  }
		[] tc_ack.timeout
		  {
			setverdict(fail);
		  }
	  }
	} //end f_awaitingResponse
	
@@ -2575,9 +2588,6 @@ group AwaitingMessage {
				f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
    			setverdict(pass);
    		}
			[] tc_ack.timeout {
    			setverdict(fail);
    		}
    	}
	} //end f_awaitingResponse
	
@@ -2624,10 +2634,6 @@ group AwaitingMessage {
			  //Answer to the INFO
			  f_send200OK();
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}
	} // end of f_awaitingINFO_sendReply
	
@@ -2651,11 +2657,6 @@ group AwaitingMessage {
			f_setHeadersOnReceiptOfINVITE(v_INVITE_Request);
			SIPP.send(m_Response_Base(c_statusLine100, vc_callId, vc_cSeq, vc_from, vc_to, vc_via)) to vc_sent_label;
		  }

		[] tc_wait.timeout
		  {
			setverdict (fail);
		  }
	  }
	} //end f_awaitingINVITE

@@ -2679,11 +2680,6 @@ group AwaitingMessage {
    		f_setHeadersOnReceiptOfINVITE(v_INVITE_Request);
    	    //SIPP.send(m_Response_Base(c_statusLine100, vc_callId, vc_cSeq, vc_from, vc_to, vc_via)) to vc_sent_label;
    	  }

		[] tc_wait.timeout
		  {
			setverdict (fail);
		  }
      }
	} //end f_awaitingInviteRequest

@@ -2730,21 +2726,6 @@ group AwaitingMessage {
		  {
			tc_ack.stop;
		  }
		// INVITE may be repeated and shall be ignored
		[]SIPP.receive(mw_INVITE_Request_Base)
		  {
			repeat;
		  }
		// Ignore othe message
		[] SIPP.receive
		  {
			repeat;
		  }

		[] tc_ack.timeout
		  {
			setverdict (fail);
		  }
	  }
	} //end f_awaitingAckRequest

@@ -2767,10 +2748,6 @@ group AwaitingMessage {
			f_setHeadersOnReceiptOfBYE(v_BYE_Request);
			//f_send200OK();
		  }
		[] tc_resp.timeout
		  {
			setverdict (fail);
		  }
	  }		
	} // end f_awaitingBYE

@@ -2794,10 +2771,6 @@ group AwaitingMessage {
			f_setHeadersOnReceiptOfBYE(v_BYE_Request);
			f_send200OK();
		  }
		 [] tc_resp.timeout
		  {
			setverdict (fail);
		  }
	  }		
	} // end f_awaitingBYE_sendReply
	
@@ -2825,7 +2798,6 @@ group AwaitingMessage {
		  {
		  	vc_boo_request := false;
		  }		
		
	  }		
	} // end f_awaitingBYE_sendReply_PassOnTimeout

@@ -2846,10 +2818,6 @@ group AwaitingMessage {
			tc_resp.stop;
			f_setHeadersOnReceiptOfRequest(v_MSG);
		  }
		[] tc_resp.timeout
		  {
			setverdict (fail);
		  }
		}		
	} // end f_awaitingCANCEL
	/** 
@@ -2874,10 +2842,6 @@ group AwaitingMessage {
			  log("Received MESSAGE not as expected!");
			  setverdict (fail);
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}
	} // end of f_awaitingMESSAGE
	
@@ -2899,10 +2863,6 @@ group AwaitingMessage {
			  //Answer to the MESSAGE
			  f_send200OK();
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}		
			
	} // end of f_awaitingMESSAGE_sendReply
@@ -2954,10 +2914,6 @@ group AwaitingMessage {
			  //Answer to the NOTIFY
			  f_send200OK();
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}
	} // end of f_awaitingNOTIFY_sendReply	

@@ -2979,11 +2935,6 @@ group AwaitingMessage {
			  //Answer to the PRACK
			  f_send200OK();
    		}

		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
    	}		
    		
    } // end of f_awaitingPRACK_sendReply
@@ -3006,10 +2957,6 @@ group AwaitingMessage {
			  //Answer to the PUBLISH
			  f_send200OK();
			}
		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}		
		
	} // end of f_awaitingPUBLISH_sendReply
@@ -3029,10 +2976,6 @@ group AwaitingMessage {
			  tc_resp.stop;
			  f_setHeadersOnReceiptOfRequest(v_MSG);
			}
 		  [] tc_resp.timeout
			{
			  setverdict (fail);
			}
		}
	} // end of f_awaitingUPDATE	
	
@@ -3054,10 +2997,6 @@ group AwaitingMessage {
				//Answer to the UPDATE
				f_send200OK();
			  }
			[] tc_resp.timeout
			  {
				setverdict (fail);
			  }
		}		

	} // end of f_awaitingUPDATE_sendReply
@@ -3078,10 +3017,6 @@ group AwaitingMessage {
				tc_resp.stop;
				f_setHeadersOnReceiptOfRequest(v_MSG);
			  }
			[] tc_resp.timeout
			  {
				setverdict (fail);
			  }
		}
	} // end of f_awaitingUPDATE
	
@@ -3278,6 +3213,17 @@ group GlobalSteps {
		stop;
	}

	/**
	 * 
	 * @desc component termination
	 */
	function f_componentStop() runs on SipComponent
	{
		syncPort.send(m_syncClientStop);
		SIPP.clear;
		stop;
	}

	/**
	 * 
	 * @desc setting of user parameters with PIXIT values
@@ -3441,6 +3387,13 @@ group Registration {
	  var Credentials v_credentials;
	  var template REGISTER_Request v_request;
	  
	  // 		
	  if(vc_DeregDone)
    	  {
    	  	f_componentStop();
    	  }
    	  else {vc_DeregDone := true;}
	  
	  if (PX_SIP_REGISTRATION)
	  {
		f_setHeaders_deREGISTER(p_cSeq);
@@ -3610,10 +3563,6 @@ group Postambles {
		  {
			tc_resp.stop;
		  }
		[] tc_resp.timeout
		  {
			stop
		  }
	  }
	} // end function f_terminateCall

@@ -3953,6 +3902,7 @@ group DefaultsTestStep
			setverdict(fail);
    		f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response); 
    		f_SendACK(m_ACK_Request_route(vc_requestUri, vc_callId, v_response.msgHeader.cSeq, vc_from, vc_to, vc_via, vc_route));
			f_RemoveRegistration(vc_cSeq); 
		}
		// catch 5xx response
		[] SIPP.receive(mw_Response_Base(mw_statusLine5xx, vc_callId, ?))-> value v_response sender vc_sent_label
@@ -3960,14 +3910,21 @@ group DefaultsTestStep
			setverdict(fail);
			f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response); 
			f_SendACK(m_ACK_Request_route(vc_requestUri, vc_callId, v_response.msgHeader.cSeq, vc_from, vc_to, vc_via, vc_route));
			f_RemoveRegistration(vc_cSeq); 
		}	
		// catch invalid REGISTER	  
		[] SIPP.receive(mw_REGISTER_Request_Base)-> value v_request sender vc_sent_label
		{
			setverdict(fail); 
			f_componentStop(); 
		}
		// any	  
	    [] SIPP.receive
		{
			setverdict(fail); 
			all timer.stop; 
			f_setHeadersCANCEL(vc_cSeq);
			f_SendCANCEL(m_CANCEL_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_cancel_To, vc_via )); // difference between registration state or transaction state
//			f_setHeadersCANCEL(vc_cSeq);
//			f_SendCANCEL(m_CANCEL_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_cancel_To, vc_via )); // difference between registration state or transaction state
			f_RemoveRegistration(vc_cSeq);
		}
	}
+25 −9
Original line number Diff line number Diff line
@@ -48,10 +48,8 @@ module LibSip_Templates
		  addrSpec := p_addrSpec
		}		

		template CommaParam_List mw_digestResponse(in GenericParam p_genericParam) :=
		{
		  *,p_genericParam,* //* c_Integrity_protected_yes
		}	
		template CommaParam_List mw_digestResponse(template GenericParam p_genericParam) :=
		  superset(p_genericParam); //* c_Integrity_protected_yes

		template SemicolonParam_List m_cpc :=
		{{"cpc",PX_SIP_ISUP_CPC_VALUE}};
@@ -67,6 +65,13 @@ module LibSip_Templates
			reasonParams := m_ReasonParams(p_cause,p_text)
		};

		template ReasonValue m_ReasonValueSIP
			(template charstring p_cause, template charstring p_text) :=
		{		  
			token := "SIP",
			reasonParams := m_ReasonParams(p_cause,p_text)
		};
		
		template RouteBody mw_routeBody (template SipUrl p_sipurl):=
		{
			nameAddr :=
@@ -774,6 +779,12 @@ module LibSip_Templates
			reasonValues := {m_ReasonValue(int2str(p_cause),?)}
		};

		template Reason mw_ReasonSIP(integer p_cause) :=
		{		  
			fieldName := REASON_E,
			reasonValues := {m_ReasonValueSIP(int2str(p_cause),?)}
		};
				
		template Require mw_Require_not_100rel :=
		{		  
			fieldName := REQUIRE_E,
@@ -1314,10 +1325,8 @@ group base_templates{
		{
			requestLine	:=
			{
				requestUri :=
					{
						hostPort:= p_requestUri.hostPort
					}
    			requestUri := p_requestUri

			},
			msgHeader :=
			{
@@ -1879,6 +1888,13 @@ group request_receive {
		}
	}

	template BYE_Request mw_BYE_Request_ReasonSIP(template CallId p_callId, integer p_cause) modifies mw_BYE_Request_Base :=
	{
		msgHeader :=
		{
			reason := mw_ReasonSIP(p_cause)
		}
	}
	template BYE_Request mw_BYE_Request_UserToUser(template CallId p_callId) modifies mw_BYE_Request_Base :=
	{
		msgHeader :=