summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-06-27 21:12:32 +0800
committerLiming Gao <liming.gao@intel.com>2018-06-28 11:19:49 +0800
commitf75a7f568e6d0944327970b3f3f2dafd9bba76b1 (patch)
treecc64f0e24e92dab5713bf2099f7e1f4fc5152ff6 /NetworkPkg/IpSecDxe/Ikev2/ChildSa.c
parent9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107 (diff)
downloadedk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.tar.gz
edk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.tar.bz2
edk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.zip
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>
Diffstat (limited to 'NetworkPkg/IpSecDxe/Ikev2/ChildSa.c')
-rw-r--r--NetworkPkg/IpSecDxe/Ikev2/ChildSa.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c b/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c
index eaccad2086..a8791cca15 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c
@@ -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.