/** @file\r
Common operation of the IKE\r
- \r
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
+\r
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
@retval TRUE This SpiValue has existed in the Child SA Session\r
@retval FALSE This SpiValue doesn't exist in the Child SA Session.\r
- \r
+\r
**/\r
BOOLEAN\r
IkeSpiValueExisted (\r
\r
Entry = NULL;\r
Next = NULL;\r
- SaSession = NULL; \r
- \r
+ SaSession = NULL;\r
+\r
//\r
// Check whether the SPI value has existed in ChildSaEstablishSessionList.\r
//\r
\r
/**\r
Call Crypto Lib to generate a random value with eight-octet length.\r
- \r
+\r
@return the 64 byte vaule.\r
\r
**/\r
Generate the random data for Nonce payload.\r
\r
@param[in] NonceSize Size of the data in bytes.\r
- \r
- @return Buffer which contains the random data of the spcified size. \r
+\r
+ @return Buffer which contains the random data of the spcified size.\r
\r
**/\r
UINT8 *\r
if (IkePayload == NULL) {\r
return NULL;\r
}\r
- \r
+\r
IkePayload->Signature = IKE_PAYLOAD_SIGNATURE;\r
\r
return IkePayload;\r
\r
/**\r
Generate an new SPI.\r
- \r
- @param[in] IkeSaSession Pointer to IKEV2_SA_SESSION related to this Child SA \r
+\r
+ @param[in] IkeSaSession Pointer to IKEV2_SA_SESSION related to this Child SA\r
Session.\r
- @param[in, out] SpiValue Pointer to the new generated SPI value. \r
- \r
+ @param[in, out] SpiValue Pointer to the new generated SPI value.\r
+\r
@retval EFI_SUCCESS The operation performs successfully.\r
@retval Otherwise The operation is failed.\r
\r
EFI_STATUS Status;\r
\r
Status = EFI_SUCCESS;\r
- \r
+\r
while (TRUE) {\r
//\r
// Generate SPI randomly\r
}\r
\r
//\r
- // The set of SPI values in the range 1 through 255 are reserved by the \r
- // Internet Assigned Numbers Authority (IANA) for future use; a reserved \r
- // SPI value will not normally be assigned by IANA unless the use of the \r
+ // The set of SPI values in the range 1 through 255 are reserved by the\r
+ // Internet Assigned Numbers Authority (IANA) for future use; a reserved\r
+ // SPI value will not normally be assigned by IANA unless the use of the\r
// assigned SPI value is specified in an RFC.\r
//\r
if (*SpiValue < IKE_SPI_BASE) {\r
- *SpiValue += IKE_SPI_BASE; \r
+ *SpiValue += IKE_SPI_BASE;\r
}\r
\r
//\r
break;\r
}\r
}\r
- \r
+\r
return Status;\r
}\r
\r