NetworkPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The operations for Child SA.
|
||||
|
||||
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -16,12 +16,12 @@
|
||||
#include "Utility.h"
|
||||
|
||||
/**
|
||||
Generate IKE Packet for CREATE_CHILD_SA exchange.
|
||||
Generate IKE Packet for CREATE_CHILD_SA exchange.
|
||||
|
||||
This IKE Packet would be the packet for creating new CHILD SA, or the packet for
|
||||
rekeying existing IKE SA, or the packet for existing CHILD SA.
|
||||
|
||||
@param[in] SaSession Pointer to related SA session.
|
||||
|
||||
@param[in] SaSession Pointer to related SA session.
|
||||
@param[in] Context The data passed by the caller.
|
||||
|
||||
return a pointer of IKE packet.
|
||||
@@ -42,12 +42,12 @@ Ikev2CreateChildGenerator (
|
||||
|
||||
NotifyPayload = NULL;
|
||||
MessageId = NULL;
|
||||
|
||||
|
||||
ChildSaSession = (IKEV2_CHILD_SA_SESSION *) SaSession;
|
||||
if (ChildSaSession == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
IkePacket = IkePacketAlloc();
|
||||
if (IkePacket == NULL) {
|
||||
return NULL;
|
||||
@@ -57,28 +57,28 @@ Ikev2CreateChildGenerator (
|
||||
if (Context != NULL) {
|
||||
MessageId = (UINT32 *) Context;
|
||||
}
|
||||
|
||||
|
||||
IkePacket->Header->Version = (UINT8) (2 << 4);
|
||||
IkePacket->Header->NextPayload = IKEV2_PAYLOAD_TYPE_NOTIFY;
|
||||
IkePacket->Header->ExchangeType = IKE_XCG_TYPE_CREATE_CHILD_SA;
|
||||
|
||||
|
||||
if (ChildSaSession->SessionCommon.IkeSessionType == IkeSessionTypeChildSa) {
|
||||
//
|
||||
// 1.a Fill the IkePacket->Hdr
|
||||
//
|
||||
//
|
||||
IkePacket->Header->InitiatorCookie = ChildSaSession->IkeSaSession->InitiatorCookie;
|
||||
IkePacket->Header->ResponderCookie = ChildSaSession->IkeSaSession->ResponderCookie;
|
||||
|
||||
|
||||
if (MessageId != NULL) {
|
||||
IkePacket->Header->MessageId = *MessageId;
|
||||
} else {
|
||||
IkePacket->Header->MessageId = ChildSaSession->MessageId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ChildSaSession->SessionCommon.IsInitiator) {
|
||||
IkePacket->Header->Flags = IKE_HEADER_FLAGS_INIT;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
IkeSaSession = (IKEV2_SA_SESSION *) SaSession;
|
||||
//
|
||||
@@ -91,8 +91,8 @@ Ikev2CreateChildGenerator (
|
||||
IkePacket->Header->MessageId = *MessageId;
|
||||
} else {
|
||||
IkePacket->Header->MessageId = IkeSaSession->MessageId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (IkeSaSession->SessionCommon.IsInitiator) {
|
||||
IkePacket->Header->Flags = IKE_HEADER_FLAGS_INIT;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ Ikev2CreateChildGenerator (
|
||||
if (MessageId != NULL) {
|
||||
IkePacket->Header->Flags |= IKE_HEADER_FLAGS_RESPOND;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// According to RFC4306, Chapter 4.
|
||||
// A minimal implementation may support the CREATE_CHILD_SA exchange only to
|
||||
@@ -110,33 +110,33 @@ Ikev2CreateChildGenerator (
|
||||
NotifyPayload = Ikev2GenerateNotifyPayload (
|
||||
0,
|
||||
IKEV2_PAYLOAD_TYPE_NONE,
|
||||
0,
|
||||
0,
|
||||
IKEV2_NOTIFICATION_NO_ADDITIONAL_SAS,
|
||||
NULL,
|
||||
NULL,
|
||||
0
|
||||
);
|
||||
if (NotifyPayload == NULL) {
|
||||
if (NotifyPayload == NULL) {
|
||||
IkePacketFree (IkePacket);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
IKE_PACKET_APPEND_PAYLOAD (IkePacket, NotifyPayload);
|
||||
//
|
||||
// TODO: Support the CREATE_CHILD_SA exchange.
|
||||
//
|
||||
// TODO: Support the CREATE_CHILD_SA exchange.
|
||||
//
|
||||
return IkePacket;
|
||||
}
|
||||
|
||||
/**
|
||||
Parse the IKE packet of CREATE_CHILD_SA exchange.
|
||||
|
||||
|
||||
This function parse the IKE packet and save the related information to further
|
||||
calculation.
|
||||
|
||||
calculation.
|
||||
|
||||
@param[in] SaSession Pointer to IKEv2_CHILD_SA_SESSION related to this Exchange.
|
||||
@param[in] IkePacket Received packet to be parsed.
|
||||
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The IKE Packet is acceptable.
|
||||
@retval EFI_UNSUPPORTED Not support the CREATE_CHILD_SA request.
|
||||
|
Reference in New Issue
Block a user