diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2016-07-20 10:53:31 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2016-09-06 19:01:04 +0800 |
commit | 96c13c011766a950247c743887705cc035a15497 (patch) | |
tree | f9fa7956c1bba8a0554b995c4ddea3101cc7a089 /NetworkPkg/IpSecDxe/IkeCommon.h | |
parent | 8c5f78a2cc15199e3f77ae4b156023af366fd6c7 (diff) | |
download | edk2-platforms-96c13c011766a950247c743887705cc035a15497.tar.xz |
NetworkPkg/IpSecDxe: Generate SPI randomly and correct IKE_SPI_BASE value
This path made the following update:
* Generate SPI randomly.
* Correct IKE_SPI_BASE value according RFC 4302/4303.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'NetworkPkg/IpSecDxe/IkeCommon.h')
-rw-r--r-- | NetworkPkg/IpSecDxe/IkeCommon.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/NetworkPkg/IpSecDxe/IkeCommon.h b/NetworkPkg/IpSecDxe/IkeCommon.h index 714ecaa8e3..7f7fd4d5b0 100644 --- a/NetworkPkg/IpSecDxe/IkeCommon.h +++ b/NetworkPkg/IpSecDxe/IkeCommon.h @@ -1,7 +1,7 @@ /** @file
Common operation of the IKE.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2016, 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
@@ -39,7 +39,7 @@ #define IKE_DEFAULT_TIMEOUT_INTERVAL 10000 // 10s
#define IKE_NONCE_SIZE 16
#define IKE_MAX_RETRY 4
-#define IKE_SPI_BASE 0x10000
+#define IKE_SPI_BASE 0x100
#define IKE_PAYLOAD_SIGNATURE SIGNATURE_32('I','K','E','P')
#define IKE_PAYLOAD_BY_PACKET(a) CR(a,IKE_PAYLOAD,ByPacket,IKE_PAYLOAD_SIGNATURE)
@@ -130,14 +130,20 @@ IkePayloadFree ( );
/**
- Generate an unused SPI
-
- @return a SPI in 4 bytes.
+ Generate an new SPI.
+
+ @param[in] IkeSaSession Pointer to IKEV2_SA_SESSION related to this Child SA
+ Session.
+ @param[in out] SpiValue Pointer to the new generated SPI value.
+
+ @retval EFI_SUCCESS The operation performs successfully.
+ @retval Otherwise The operation is failed.
**/
-UINT32
+EFI_STATUS
IkeGenerateSpi (
- VOID
+ IN IKEV2_SA_SESSION *IkeSaSession,
+ OUT UINT32 *SpiValue
);
/**
|