Commit 9f8520e1 authored by berge's avatar berge
Browse files

Fixed TC_MOB_1625_01 and TC_SEC_2009_01

parent 18943782
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -1177,6 +1177,49 @@ group rfc4303Esp_ExtHdrFunctions {
			ipSecProtocolMode := PX_IP_SEC_PROTOCOL_MODE
		}
		
		// SAD-OUT
		vc_sad[c_saCnOut] := {
			spi := c_saCnOut/*f_createSpi()*/,
			seqNr := c_uInt32Zero,
			// AH Integrity
			ahIntegrityAlgo := PX_INTEGRITY_ALGO,
			ahIntegrityKey := PX_INTEGRITY_KEY/*f_createSecretKey()*/,
			icvLen := f_getIcvLen(PX_INTEGRITY_ALGO),
			icvPadLen := f_getIcvPadLen(PX_INTEGRITY_ALGO),
			// ESP encryption
			espEncryptionAlgo := PX_ENCRYPTION_ALGO,
			espEncryptionKey := PX_ESP_ENCR_KEY/*f_createSecretKey()*/,
			// ESP integrity
			espIntegrityAlgo := PX_INTEGRITY_ALGO,
			espIntegrityKey := PX_INTEGRITY_KEY/*f_createSecretKey()*/,
			// Combined mode
			espCombinedModeAlgo := PX_COMBINED_MODE_ALGO,
			espCombinedModeKey := PX_COMBINED_MODE_KEY/*f_createSecretKey()*/,
			// Protocol mode
			ipSecProtocolMode := PX_IP_SEC_PROTOCOL_MODE
		}
		// SAD-IN
		vc_sad[c_saCnIn] := {
			spi := c_saCnIn/*f_createSpi()*/,
			seqNr := c_uInt32Zero,
			// AH Integrity
			ahIntegrityAlgo := PX_INTEGRITY_ALGO,
			ahIntegrityKey := PX_INTEGRITY_KEY/*f_createSecretKey()*/,
			icvLen := f_getIcvLen(PX_INTEGRITY_ALGO),
			icvPadLen := f_getIcvPadLen(PX_INTEGRITY_ALGO),
			// ESP encryption
			espEncryptionAlgo := PX_ENCRYPTION_ALGO,
			espEncryptionKey := PX_ESP_ENCR_KEY/*f_createSecretKey()*/,
			// ESP integrity
			espIntegrityAlgo := PX_INTEGRITY_ALGO,
			espIntegrityKey := PX_INTEGRITY_KEY/*f_createSecretKey()*/,
			// Combined mode
			espCombinedModeAlgo := PX_COMBINED_MODE_ALGO,
			espCombinedModeKey := PX_COMBINED_MODE_KEY/*f_createSecretKey()*/,
			// Protocol mode
			ipSecProtocolMode := PX_IP_SEC_PROTOCOL_MODE
		}		

		//TODO chose in function of PX_SPI the SAD to be used for testing
//		v_ret := fx_setSecurityParameters(Sad:{vc_sad[c_saOut]});
		v_ret := fx_setSecurityParameters(vc_sad);
+3 −1
Original line number Diff line number Diff line
@@ -1156,6 +1156,8 @@ module LibIpv6_Interface_TypesAndValues {
		const UInt8 c_saIn := 1;
		const UInt8 c_saRrpOut := 2;
		const UInt8 c_saRrpIn := 3; 
		const UInt8 c_saCnOut := 4;
		const UInt8 c_saCnIn := 5;
		

		//Security Association
+33 −31
Original line number Diff line number Diff line
@@ -1395,32 +1395,33 @@ group mobileSecurityFns {
														m_dstOpt_padN(m_optPad4),
														m_dstOpt_homeAddr(p_mnHoaTn)))),
											c_defId));
		} else {
			v_ret := f_sendMipPrefixSol(m_mobilePrefixSol(
											c_espHdr,
		} else { // e_securityOn
			v_ret := f_sendMipPrefixSol(m_mobilePrefixSol_esp(
											c_dstHdr,
											p_mnCoaTn,
											p_haGlaNut,
											m_extHdrList_1Elem(
												m_extHdr_espHeader(
													vc_sad[c_saOut].spi,
													vc_sad[c_saOut].seqNr + 1,
													m_espIpDatagram(
														m_extHdrList_1Elem(
											m_extHdrList_2Elem(
												m_extHdr_dstOptHeader(	
																c_icmpHdr,
													c_espHdr,
													c_optLen2,
													m_dstOptList_2Elem(
														m_dstOpt_padN(m_optPad4),
																	m_dstOpt_homeAddr(p_mnHoaTn)))),
														omit ),
													c_dstHdr ) ),
											c_defId));
														m_dstOpt_homeAddr(p_mnHoaTn))),
												m_extHdr_espHeader(
													vc_sad[c_saOut].spi,
													vc_sad[c_saOut].seqNr,
													m_espIpDatagram(
														omit,
														m_ipv6Payload_mobilePrefixSolMsg(
															m_mobilePrefixSolMsg(
																c_defId))),
													c_icmpHdr))));

		}
		if ( v_ret != e_success ) {return v_ret;}
		tc_ac.start;
		alt {
			[PX_IP_SEC == e_securityOff]	ipPort.receive(mw_mobilePrefixAdv_extHdr(
			[/*PX_IP_SEC == e_securityOff*/]	ipPort.receive(mw_mobilePrefixAdv_extHdr(
									c_routeHdr,
									p_haGlaNut,
									p_mnCoaTn,
@@ -1434,28 +1435,29 @@ group mobileSecurityFns {
					tc_ac.stop;
					v_ret := e_success ;
				}
			[PX_IP_SEC == e_securityOn]	ipPort.receive(mw_mobilePrefixAdv_extHdr(
									c_espHdr,
/*			[PX_IP_SEC == e_securityOn]	ipPort.receive(mw_mobilePrefixAdv_esp(
									c_routeHdr,
									p_haGlaNut,
									p_mnCoaTn,
									m_extHdrList_1Elem(
										m_extHdr_espHeader(
											?,//vc_sad[c_saIn].spi,
											?,//vc_sad[c_saOut].seqNr + 1,
											m_espIpDatagram(									
												m_extHdrList_1Elem(
									m_extHdrList_2Elem(
										mw_extHdr_routingHeader(	
														c_icmpHdr,
											c_espHdr,
											c_routeHdrLen2,
											c_routeHdrType2,
											c_routeHdrSegmentsLeft1,
														m_routingHeaderData_homeAddress(p_mnHoaTn))),
												omit),
											c_routeHdr)))) {
											m_routingHeaderData_homeAddress(p_mnHoaTn)),
										mw_extHdr_espHeader(
											vc_sad[c_saIn].spi,
											?,//vc_sad[c_saOut].seqNr + 1,
											m_espIpDatagram(									
												omit,
												m_ipv6Payload_mobilePrefixAdvMsg(
													mw_mobilePrefixAdvMsg())),
											c_icmpHdr)))) {
					tc_ac.stop;
					v_ret := e_success ;
				}
			[]	tc_ac.timeout{
	*/		[]	tc_ac.timeout{
					v_ret :=  e_timeout;
					log("**** f_sendMipPrefixSolAndWaitForReply: ERROR: tc_ac.timeout **** ");
				}		
+46 −1
Original line number Diff line number Diff line
@@ -119,6 +119,27 @@
		}}
	}

	template MobilePrefixSolicitation m_mobilePrefixSol_esp (	UInt8 p_nextHdr,
														template Ipv6Address p_src,
														template Ipv6Address p_dst,
														template ExtensionHeaderList p_extHdrList):= {
		ipv6Hdr :=  m_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst),
		extHdrList := p_extHdrList,
		ipv6Payload := omit
	}

	template Ipv6Payload m_ipv6Payload_mobilePrefixSolMsg(in template MobilePrefixSolicitationMsg p_mobilePrefixSolMsg) := {
		mobilePrefixSolMsg := p_mobilePrefixSolMsg
	}

	template MobilePrefixSolicitationMsg m_mobilePrefixSolMsg (UInt16 p_ident):= {
		icmpType := c_mobilePrefixSolicitation,
		icmpCode := c_icmpCode0,
		checksum := c_2ZeroBytes,
		identifier := p_ident,
		reserved := c_uInt16Zero		
	}

	template MobilePrefixSolicitation mw_mobilePrefixSol (	
															template Ipv6Address p_src,
															template Ipv6Address p_dst	):= {
@@ -192,6 +213,30 @@
		}}
	}
	
	template MobilePrefixAdvertisement mw_mobilePrefixAdv_esp (	UInt8 p_nextHdr,
														template Ipv6Address p_src,
														template Ipv6Address p_dst,
														template ExtensionHeaderList p_extHdrList):= {
		ipv6Hdr :=  m_ipHdr_nextHdr_srcDst(p_nextHdr, p_src, p_dst),
		extHdrList := p_extHdrList,
		ipv6Payload := omit
	}	

	template Ipv6Payload m_ipv6Payload_mobilePrefixAdvMsg(in template MobilePrefixAdvertisementMsg p_mobilePrefixAdvMsg) := {
		mobilePrefixAdvMsg := p_mobilePrefixAdvMsg
	}

	template MobilePrefixAdvertisementMsg mw_mobilePrefixAdvMsg ():= {
		icmpType := c_mobilePrefixAdvertisement,
		icmpCode := ?,
		checksum := ?,
		identifier := ?,
		mFlag := ?,
		oFlag := ?,
		reserved := ?,
		mobilePrefixInfoList := ?		
	}

	}//end group mobilePrefixAdvertisementTemplates
		
} // end module LibIpv6_Rfc3775Mipv6_Templates
+2 −2
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ group IcmpAndAuthHeaderFns {
				v_nbrSol := valueof(m_nbrSol_extHdr (
					c_authHdr,
					p_paramsTn.gla,
					p_paramsIut.gla,
					p_paramsIut.solNodeMca,
					m_nbrSolOpt_sllaOpt ( p_paramsTn.macUca ),
					m_extHdrList_1Elem (
						m_extHdr_AHHeaders(
@@ -833,7 +833,7 @@ group IcmpAndAuthHeaderFns {
				v_nbrSol := valueof(m_nbrSol_extHdr (
					c_authHdr,
					p_paramsTn.gla,
					p_paramsIut.gla,
					p_paramsIut.solNodeMca,
					m_nbrSolOpt_sllaOpt ( p_paramsTn.macUca ),
					m_extHdrList_1Elem (
						m_extHdr_AHHeaders(