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>
This commit is contained in:
Jiaxin Wu
2016-07-20 10:53:31 +08:00
parent 8c5f78a2cc
commit 96c13c0117
3 changed files with 112 additions and 21 deletions

View File

@@ -525,7 +525,16 @@ Ikev2ChildSaSessionAlloc (
ChildSaSession->Signature = IKEV2_CHILD_SA_SESSION_SIGNATURE;
ChildSaSession->IkeSaSession = IkeSaSession;
ChildSaSession->MessageId = IkeSaSession->MessageId;
ChildSaSession->LocalPeerSpi = IkeGenerateSpi ();
//
// Generate an new SPI.
//
Status = IkeGenerateSpi (IkeSaSession, &(ChildSaSession->LocalPeerSpi));
if (EFI_ERROR (Status)) {
FreePool (ChildSaSession);
return NULL;
}
ChildSaCommon = &ChildSaSession->SessionCommon;
ChildSaCommon->UdpService = UdpService;
ChildSaCommon->Private = IkeSaSession->SessionCommon.Private;