Commit bfa4136e authored by schmitting's avatar schmitting
Browse files

tunnel and transport mode for active IKE SA establishment

parent cc3e3c57
Loading
Loading
Loading
Loading
+149 −82
Original line number Diff line number Diff line
@@ -1321,6 +1321,9 @@ group sendRequests {
			);
		}

		// Transport mode, Notify payload requesting 'UseTransportMode' is included in IKE_AUTH request
		if(vc_sad[c_saOut].ipSecProtocolMode == e_transportMode)
		{
			v_ret := f_sendIkeAuthReq (
				m_ikeAuthReq (
					p_addrTn,
@@ -1376,13 +1379,81 @@ group sendRequests {
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											p_addrTn,
											p_addrTn
									)//,
									//m_icmpv6Ts(
									//	32768,
									//	33023,
									//	p_addrTn,
									//	p_addrTn
									//)
										)
									)
								),
								m_tsResponderPL(
									c_noNextPL,
									m_trafficSelectorList_1Elem (
										m_icmpv6Ts(
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											p_addrIut,
											p_addrIut
										)
									)
								)	
							)
						)
					)
				)
			);
		}

		// Tunnel mode, Notify payload requesting 'UseTransportMode' is not included in IKE_AUTH request
		else
		{
			v_ret := f_sendIkeAuthReq (
				m_ikeAuthReq (
					p_addrTn,
					p_addrIut,
					PX_UDP_PORT_HS02,
					PX_UDP_PORT_IUT_1,
					vc_ikeSad[0].spiInitiator,
					vc_ikeSad[0].spiResponder,
					c_encryptedPL,
					vc_ikeSad[0].messageID,
					m_ikePlList_1Elem(
						m_encryptedPL(
							c_notifyPL,
							m_ikePlList_5Elem(
								m_idInitiatorPL (	
									c_authenticationPL,
									p_addrTn
								),
								m_authPL (	
									c_saPL,
									f_calculateAUTH(vc_ikeSad[0],c_initiator)
								),
								m_securityAssociationPL(
									c_tsInitiatorPL,
									m_saProposalIke(
										c_lastProposal,
										c_proposalNr1,
										c_protocolId_esp,
										c_spiSize4,
										c_2Transforms,
										int2oct(vc_sad[c_saOut].spi,c_spiSize4),
										m_saTransformList_2Elem (
											v_saTransformEncr,
											m_saTransform (
												c_lastTransform,
												c_transformTypeInteg,
												m_transformId_integ(vc_sad[c_saOut].espIntegrityAlgo),
												omit//Attribute
											)
										)
									)
								),
								m_tsInitiatorPL(
									c_tsResponderPL,
									m_trafficSelectorList_1Elem (
										m_icmpv6Ts(
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											p_addrTn,
											p_addrTn
										)
									)
								),
								m_tsResponderPL(
@@ -1393,13 +1464,7 @@ group sendRequests {
											oct2int(int2oct(c_echoRequestMsg,2) & int2oct(c_icmpCode0,2)),
											p_addrIut,
											p_addrIut
									)//,
									//m_icmpv6Ts(
									//	32768,//c_echoRequestMsg,
									//	33023,
									//	p_addrIut,
									//	p_addrIut
									//)
										)
									)
								)	
							)
@@ -1407,6 +1472,8 @@ group sendRequests {
					)
				)
			);
		}

	if (v_ret != e_success) { return v_ret;}

		return v_ret ;