\r
#include "IkeService.h"\r
#include "IpSecConfigImpl.h"\r
-#include "Ikev2/Utility.h"\r
\r
IKE_EXCHANGE_INTERFACE *mIkeExchange[] = {\r
&mIkev1Exchange,\r
/** @file\r
Prototypes definitions of IKE service.\r
\r
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2015, 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
#include "Ike.h"\r
#include "IpSecImpl.h"\r
#include "IkeCommon.h"\r
+#include "Ikev2/Utility.h"\r
\r
#define IPSEC_CRYPTO_LIB_MEMORY 128 * 1024\r
\r
/** @file\r
The general interfaces of the IKEv2.\r
\r
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2015, 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
// Send out the Packet\r
//\r
- if (UdpService != NULL) {\r
+ if (UdpService != NULL && UdpService->Output != NULL) {\r
Status = Ikev2SendIkePacket (UdpService, (UINT8 *) SaCommon, IkePacket, 0);\r
\r
if (EFI_ERROR (Status)) {\r
//\r
// Send out the Packet\r
//\r
- if (UdpService != NULL) {\r
+ if (UdpService != NULL && UdpService->Output != NULL) {\r
Status = Ikev2SendIkePacket (UdpService, (UINT8 *) &ChildSaSession->SessionCommon, IkePacket, 0);\r
\r
if (EFI_ERROR (Status)) {\r
The Common operations used by IKE Exchange Process.\r
\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2015, 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
RemoteSelector = NULL;\r
UdpService = IkeSaSession->SessionCommon.UdpService;\r
\r
- Private = (UdpService->IpVersion == IP_VERSION_4) ?\r
- IPSEC_PRIVATE_DATA_FROM_UDP4LIST(UdpService->ListHead) :\r
- IPSEC_PRIVATE_DATA_FROM_UDP6LIST(UdpService->ListHead);\r
+ Private = IkeSaSession->SessionCommon.Private;\r
\r
//\r
// Remove the Established SA from ChildSaEstablishlist.\r
/** @file\r
Driver Binding Protocol for IPsec Driver.\r
\r
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, 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
IKE_UDP_SERVICE *UdpSrv;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
+ IKEV2_SA_SESSION *Ikev2SaSession;\r
\r
//\r
// Locate ipsec protocol to get private data.\r
//\r
if ((IpVersion == IP_VERSION_4 && Private->Udp6Num ==0) ||\r
(IpVersion == IP_VERSION_6 && Private->Udp4Num ==0)) {\r
- IkeDeleteAllSas (Private, FALSE);\r
+ //\r
+ // If IKEv2 SAs are under establishing, delete it directly.\r
+ //\r
+ if (!IsListEmpty (&Private->Ikev2SessionList)) {\r
+ NET_LIST_FOR_EACH_SAFE (Entry, Next, &Private->Ikev2SessionList) {\r
+ Ikev2SaSession = IKEV2_SA_SESSION_BY_SESSION (Entry);\r
+ RemoveEntryList (&Ikev2SaSession->BySessionTable);\r
+ Ikev2SaSessionFree (Ikev2SaSession);\r
+ }\r
+ }\r
+\r
+ //\r
+ // Delete established IKEv2 SAs.\r
+ //\r
+ if (!IsListEmpty (&Private->Ikev2EstablishedList)) {\r
+ NET_LIST_FOR_EACH_SAFE (Entry, Next, &Private->Ikev2EstablishedList) {\r
+ Ikev2SaSession = IKEV2_SA_SESSION_BY_SESSION (Entry); \r
+ RemoveEntryList (&Ikev2SaSession->BySessionTable);\r
+ Ikev2SaSessionFree (Ikev2SaSession);\r
+ }\r
+ }\r
}\r
\r
if (IpVersion == IP_VERSION_4) {\r