NetworkPkg: Remove unused variables from IpSecDxe to fix GCC build.
authorSamer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
Wed, 1 Jul 2015 03:35:32 +0000 (03:35 +0000)
committersfu5 <sfu5@Edk2>
Wed, 1 Jul 2015 03:35:32 +0000 (03:35 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17773 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/IpSecDxe/Ikev2/Info.c
NetworkPkg/IpSecDxe/Ikev2/Payload.c
NetworkPkg/IpSecDxe/Ikev2/Sa.c
NetworkPkg/IpSecDxe/Ikev2/Utility.c
NetworkPkg/IpSecDxe/IpSecImpl.c

index d297564f11c23d2595bafd3071b7effd0780c7b6..fe75d6c59610d357f354be249fcc710a281e2c88 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   The Implementations for Information Exchange.\r
 \r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -211,7 +212,6 @@ Ikev2InfoParser (
 {\r
   IKEV2_CHILD_SA_SESSION *ChildSaSession;\r
   IKEV2_SA_SESSION       *IkeSaSession;\r
-  IKE_PAYLOAD            *NotifyPayload;\r
   IKE_PAYLOAD            *DeletePayload;\r
   IKE_PAYLOAD            *IkePayload;\r
   IKEV2_DELETE           *Delete;\r
@@ -229,7 +229,6 @@ Ikev2InfoParser (
   \r
   IkeSaSession   = (IKEV2_SA_SESSION *) SaSession;\r
 \r
-  NotifyPayload  = NULL;\r
   DeletePayload  = NULL;\r
   Private        = NULL;\r
   RespondPacket  = NULL;\r
index 012e8c24b321bf02d027d50b37447e9c8e74df03..b92ae3a599f46cba6f13d3f476dc5ba799156bf5 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   The implementation of Payloads Creation.\r
 \r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -284,7 +285,6 @@ Ikev2GenerateCertIdPayload (
   IKE_PAYLOAD    *IdPayload;\r
   IKEV2_ID       *Id;\r
   UINTN          IdSize;\r
-  UINT8          IpVersion;\r
   UINTN          SubjectSize;\r
   UINT8          *CertSubject;\r
 \r
@@ -304,7 +304,6 @@ Ikev2GenerateCertIdPayload (
 \r
   SubjectSize = 0;\r
   CertSubject = NULL;\r
-  IpVersion = CommonSession->UdpService->IpVersion;\r
   IpSecCryptoIoGetSubjectFromCert (\r
     InCert,\r
     CertSize,\r
@@ -615,7 +614,6 @@ Ikev2CertGenerateAuthPayload (
   UINTN              DigestSize;\r
   PRF_DATA_FRAGMENT  Fragments[3];\r
   UINT8              *KeyBuf;\r
-  UINTN              KeySize;\r
   IKE_PAYLOAD        *AuthPayload;\r
   IKEV2_AUTH         *PayloadBuf;\r
   EFI_STATUS         Status;\r
@@ -663,7 +661,6 @@ Ikev2CertGenerateAuthPayload (
   ASSERT (KeyBuf != NULL);\r
 \r
   CopyMem (KeyBuf, Digest, DigestSize);\r
-  KeySize = DigestSize;\r
 \r
   //\r
   // Calculate Prf(SK_Pi/r, IDi/r)\r
@@ -2558,14 +2555,12 @@ Ikev2DecryptPacket (
   IKEV2_CHILD_SA_SESSION *ChildSaSession;\r
   EFI_STATUS             Status;\r
   UINT8                  PadLen;\r
-  UINTN                  CryptKeyLength;\r
   HASH_DATA_FRAGMENT     Fragments[1];\r
 \r
   IvSize         = 0;\r
   IkeSaSession   = NULL;\r
   CryptBlockSize = 0;\r
   CheckSumSize   = 0;\r
-  CryptKeyLength = 0;\r
 \r
   //\r
   // Check if the first payload is the Encrypted payload\r
@@ -2583,7 +2578,7 @@ Ikev2DecryptPacket (
   if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) {\r
 \r
     CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId);\r
-    CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId);\r
+\r
     CheckSumSize   = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId);\r
     IkeSaSession   = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon);\r
 \r
@@ -2592,7 +2587,6 @@ Ikev2DecryptPacket (
     ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon);\r
     IkeSaSession   = ChildSaSession->IkeSaSession;\r
     CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);\r
-    CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);\r
     CheckSumSize   = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId);\r
   } else {\r
     //\r
@@ -2768,7 +2762,6 @@ Ikev2EncryptPacket (
   UINT8                  *EncryptPayloadBuf;  // Contain whole Encrypted Payload\r
   UINTN                  EncryptPayloadSize;  // Total size of the Encrypted payload\r
   UINT8                  *IntegrityBuf;       // Buffer to be intergity\r
-  UINT32                 IntegrityBufSize;    // Buffer size of IntegrityBuf\r
   UINT8                  *IvBuffer;           // Initialization Vector\r
   UINT8                  IvSize;              // Iv Size\r
   UINT8                  CheckSumSize;        // Integrity Check Sum Size depends on intergrity Auth\r
@@ -2780,7 +2773,6 @@ Ikev2EncryptPacket (
   EFI_STATUS             Status;\r
   LIST_ENTRY             *Entry;\r
   IKE_PAYLOAD            *IkePayload;\r
-  UINTN                  CryptKeyLength;\r
   HASH_DATA_FRAGMENT     Fragments[1];\r
 \r
   Status = EFI_SUCCESS;\r
@@ -2795,7 +2787,6 @@ Ikev2EncryptPacket (
   IkeSaSession      = NULL;\r
   CryptBlockSize    = 0;\r
   CheckSumSize      = 0;\r
-  CryptKeyLength    = 0;\r
   IntegrityBuf      = NULL;\r
   //\r
   // Get the Block Size\r
@@ -2803,7 +2794,6 @@ Ikev2EncryptPacket (
   if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) {\r
 \r
     CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId);\r
-    CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId);\r
     CheckSumSize   = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId);\r
     IkeSaSession   = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon);\r
 \r
@@ -2812,7 +2802,6 @@ Ikev2EncryptPacket (
     ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon);\r
     IkeSaSession   = ChildSaSession->IkeSaSession;\r
     CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);\r
-    CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);\r
     CheckSumSize   = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId);\r
   }\r
 \r
@@ -2919,7 +2908,6 @@ Ikev2EncryptPacket (
     Status = EFI_OUT_OF_RESOURCES;\r
     goto ON_EXIT;\r
   }\r
-  IntegrityBufSize               = IkePacket->Header->Length;\r
   IkeHdrHostToNet (IkePacket->Header);\r
 \r
   CopyMem (IntegrityBuf, IkePacket->Header, sizeof (IKE_HEADER));\r
index ae13e4d1b42616f9281ce57c40afdad9e0d39442..9967e1a682ae198d30bbd3cd162fa1be43e58643 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   The operations for IKEv2 SA.\r
 \r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -1132,7 +1133,6 @@ Ikev2AuthCertParser (
   IKE_PAYLOAD            *TsiPayload;\r
   IKE_PAYLOAD            *TsrPayload;\r
   IKE_PAYLOAD            *CertPayload;\r
-  IKE_PAYLOAD            *CertReqPayload;\r
   IKE_PAYLOAD            *VerifiedAuthPayload;\r
   LIST_ENTRY             *Entry;\r
   EFI_STATUS             Status;\r
@@ -1151,7 +1151,6 @@ Ikev2AuthCertParser (
   TsiPayload          = NULL;\r
   TsrPayload          = NULL;\r
   CertPayload         = NULL;\r
-  CertReqPayload      = NULL;\r
   VerifiedAuthPayload = NULL;\r
   Status              = EFI_INVALID_PARAMETER;\r
 \r
@@ -1183,9 +1182,6 @@ Ikev2AuthCertParser (
     if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERT) {\r
       CertPayload = IkePayload;\r
     }\r
-    if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERTREQ) {\r
-      CertReqPayload = IkePayload;\r
-    }\r
   }\r
 \r
   if ((SaPayload == NULL) || (AuthPayload == NULL) || (TsiPayload == NULL) || \r
@@ -1478,7 +1474,6 @@ Ikev2GenerateSaKeys (
 {\r
   EFI_STATUS          Status;\r
   IKEV2_SA_PARAMS     *SaParams;\r
-  IPSEC_PAD_ENTRY     *Pad;\r
   PRF_DATA_FRAGMENT   Fragments[4];\r
   UINT64              InitiatorCookieNet;\r
   UINT64              ResponderCookieNet;\r
@@ -1503,8 +1498,6 @@ Ikev2GenerateSaKeys (
   //\r
   Ikev2GenerateSaDhComputeKey (IkeSaSession->IkeKeys->DhBuffer, KePayload);\r
 \r
-  Pad = IkeSaSession->Pad;\r
-\r
   //\r
   // Get the key length of Authenticaion, Encryption, PRF, and Integrity.\r
   //\r
index cb436b65a69eb09b7f0d760e3570fd1bf60e163e..8769850d41bb5c723e402281750f42d96abc514a 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\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
 \r
   This program and the accompanying materials\r
@@ -571,7 +572,6 @@ Ikev2ChildSaSessionReg (
   IKEV2_SESSION_COMMON         *SessionCommon;\r
   IKEV2_CHILD_SA_SESSION       *OldChildSaSession;\r
   IKEV2_SA_SESSION             *IkeSaSession;\r
-  IKEV2_SA_PARAMS              *SaParams;\r
   EFI_STATUS                   Status;\r
   UINT64                       Lifetime;\r
 \r
@@ -624,7 +624,6 @@ Ikev2ChildSaSessionReg (
   //\r
   // Start to count the lifetime of the IKE SA.\r
   //\r
-  SaParams = SessionCommon->SaParams;\r
   if (ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime != 0){\r
     Lifetime = ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime;\r
   } else {\r
index 347bdd994ef45201d70f93b6401643b9c2c82f36..3a8a6e9b584f69d036ff35ebd4ee721ffc8893b7 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   The implementation of IPsec.\r
 \r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -898,7 +899,6 @@ IpSecIsIp6ExtsValid (
   UINT32                     Pointer;\r
   UINT8                      *Option;\r
   UINT8                      OptionLen;\r
-  BOOLEAN                    Flag;\r
   UINT8                      CountD;\r
   UINT8                      CountF;\r
   UINT8                      CountA;\r
@@ -918,7 +918,6 @@ IpSecIsIp6ExtsValid (
   }\r
 \r
   Pointer = 0;\r
-  Flag    = FALSE;\r
   CountD  = 0;\r
   CountF  = 0;\r
   CountA  = 0;\r
@@ -931,8 +930,6 @@ IpSecIsIp6ExtsValid (
         return FALSE;\r
       }\r
 \r
-      Flag = TRUE;\r
-\r
     //\r
     // Fall through\r
     //\r