Commit 42fe33c0 authored by berge's avatar berge
Browse files

3 + 4 validated except TS payload

parent ab09e288
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ module LibIpv6_ModuleParameters {
	/*
	 * @desc Which encryption algorithm shall be used for testing IKE?
	*/
	modulepar {EncryptionAlgo PX_IKE_ENCALGO := e_encr_desIv64}
	modulepar {EncryptionAlgo PX_IKE_ENCALGO := e_encr_3Des}

//	modulepar {octetstring PX_IKE_ENC_KEY := '010203040506'O}

@@ -110,7 +110,7 @@ module LibIpv6_ModuleParameters {
	/*
	 * @desc Which Diffie-Hellman group shall be used for testing IKE?
	*/
	modulepar {DiffieHellmanGroup PX_IKE_DIFFIEHELLMAN_GROUP := e_group1ModP768Bit} 
	modulepar {DiffieHellmanGroup PX_IKE_DIFFIEHELLMAN_GROUP := e_group2ModP1024Bit} 

	/*
	 * @desc Which private key for the Diffie-Hellman exchange shall be used for testing IKE?
@@ -126,7 +126,7 @@ module LibIpv6_ModuleParameters {
	/*
	 * @desc Which pre-shared secret shall be used for calculating the AUTH value?
    */
	modulepar {octetstring PX_PRE_SHARED_SECRET := '0123456789ABCDEF'O}
	modulepar {octetstring PX_PRE_SHARED_KEY := '0123456789ABCDEF'O}

	/*
	 * @desc Which identification data (type = ID_IPV6_ADDR) shall be used for sending in Identification payloads?
@@ -137,8 +137,8 @@ module LibIpv6_ModuleParameters {

group udpPxts {
	
	modulepar {UInt16 PX_UDP_PORT_IUT_1 := 23000}
	modulepar {UInt16 PX_UDP_PORT_HS02 := 23055}
	modulepar {UInt16 PX_UDP_PORT_IUT_1 := 500}
	modulepar {UInt16 PX_UDP_PORT_HS02 := 500}
	
}//end udpPxts

+13 −10
Original line number Diff line number Diff line
@@ -394,11 +394,12 @@ module LibIpv6_Rfc4306Ikev2_Functions {
		var octetstring v_aUTH;
		var octetstring v_auxiliary;
		
		if(p_initatorOrResponder == c_initiator)  // IUT acts as initiatorr
		if(p_initatorOrResponder == c_initiator)  // IUT acts as initiator
		{
			v_auxiliary := p_IkeSa.nR &
						   fx_pseudoRandom(p_IkeSa.ikePseudoRandomFunction,
									       p_IkeSa.sevenSecrets.sK_pi,
									       '05000000'O &
										   p_IkeSa.iDi);
		}
		else // IUT acts as responder
@@ -411,7 +412,7 @@ module LibIpv6_Rfc4306Ikev2_Functions {

		v_aUTH := fx_pseudoRandom(p_IkeSa.ikePseudoRandomFunction,
								  fx_pseudoRandom(p_IkeSa.ikePseudoRandomFunction,
												  PX_PRE_SHARED_SECRET,
												  PX_PRE_SHARED_KEY,
												  c_authString),
								  (fx_ikev2HeaderToOct(p_IkeSa.ikev2Header) & 
								   fx_ikePayloadListToOct(p_IkeSa.ikePayloadList) &
@@ -1343,13 +1344,13 @@ group establishSAFns_active {
										c_lastProposal,
										c_proposalNr1,
										c_protocolId_esp,
										c_spiSize0,
										c_spiSize4,
										c_2Transforms,
										omit,//spiInitiator
										int2oct(vc_sad[c_saOut].spi,c_spiSize4),
										m_saTransformList_2Elem (
											v_saTransformEncr,
											m_saTransform (
												c_moreTransform,
												c_lastTransform,
												c_transformTypeInteg,
												m_transformId_integ(vc_sad[c_saOut].espIntegrityAlgo),
												omit//Attribute
@@ -1358,10 +1359,11 @@ group establishSAFns_active {
									)
								),
								m_tsInitiatorPL(
									c_noNextPL,
									c_tsResponderPL,
									m_trafficSelectorList_1Elem (
										m_icmpv6Ts(
											c_echoRequestMsg,
											0,//oct2int(in2oct(c_echoRequestMsg) & int2oct(c_icmpCode)),
											65535,
											p_addrTn,
											p_addrTn
										)
@@ -1371,7 +1373,8 @@ group establishSAFns_active {
									c_noNextPL,
									m_trafficSelectorList_1Elem (
										m_icmpv6Ts(
											c_echoRequestMsg,
											0,//c_echoRequestMsg,
											65535,
											p_addrIut,
											p_addrIut
										)
@@ -1389,7 +1392,7 @@ group establishSAFns_active {
		}
		
		// wait for IKE_AUTH response
		v_ret := f_waitForIkeAuthRsp(p_addrTn,p_addrIut);//todo make it for tunnel mode as well
		v_ret := f_waitForIkeAuthRsp(p_addrIut, p_addrTn);//todo make it for tunnel mode as well
		if (v_ret != e_success) { return v_ret;}
		
		//fill keyLen
+4 −3
Original line number Diff line number Diff line
@@ -745,7 +745,8 @@ group trafficSelectionPLTmplts {
	}

	template TsTrafficSelector m_icmpv6Ts(
		UInt8 p_icmpType,
		UInt16 p_startPort,
		UInt16 p_endPort,
		template Ipv6Address	p_startAddress,
		template Ipv6Address	p_endAddress
	) := {
@@ -753,8 +754,8 @@ group trafficSelectionPLTmplts {
			tsType := c_tsIpv6AddrRange,
			ipProtocolId := c_icmpHdr,
			tsLength := 40,
			startPort := p_icmpType,
			endPort := p_icmpType,
			startPort := p_startPort,
			endPort := p_endPort,
			startAddress := p_startAddress,
			endAddress := p_endAddress
		}
+3 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@

		const boolean c_initiator := true;
		const boolean c_responder := false;
		const octetstring c_authString := '4865792050414420466F72204948457632'O // ASCII coding for string 'Key Pad for IKEv2'
		const octetstring c_authString := '4B65792050616420666F7220494B457632'O // ASCII coding for string 'Key Pad for IKEv2'
										  

	} // end group IkeRfc4306CommonConstants
		
@@ -104,6 +105,7 @@

		group IkeRfc4306SpiTypes {
			const UInt8 c_spiSize0 := 0;
			const UInt8 c_spiSize4 := 4;
			const Oct8	c_zeroResponderSpi 	:= '0000000000000000'O;
		} // end group IkeRfc4306SpiTypes