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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user