Samer The patch is good to me. Reviewed-by: Fu Siyuan <siyuan...@intel.com>
-----Original Message----- From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hp.com] Sent: Sunday, June 28, 2015 1:12 PM To: edk2-devel@lists.sourceforge.net Subject: [edk2] [PATCH] NetworkPkg: Remove unused variables from IpSecDxe to fix GCC build Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahm...@hp.com> --- NetworkPkg/IpSecDxe/Ikev2/Info.c | 3 +-- NetworkPkg/IpSecDxe/Ikev2/Payload.c | 15 +-------------- NetworkPkg/IpSecDxe/Ikev2/Sa.c | 6 +----- NetworkPkg/IpSecDxe/Ikev2/Utility.c | 3 +-- NetworkPkg/IpSecDxe/IpSecImpl.c | 4 +--- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/NetworkPkg/IpSecDxe/Ikev2/Info.c b/NetworkPkg/IpSecDxe/Ikev2/Info.c index d297564..d74a9b9 100644 --- a/NetworkPkg/IpSecDxe/Ikev2/Info.c +++ b/NetworkPkg/IpSecDxe/Ikev2/Info.c @@ -1,6 +1,7 @@ /** @file The Implementations for Information Exchange. + (C) Copyright 2014 - 2015 Hewlett-Packard Development Company, + L.P.<BR> Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -211,7 +212,6 @@ Ikev2InfoParser ( { IKEV2_CHILD_SA_SESSION *ChildSaSession; IKEV2_SA_SESSION *IkeSaSession; - IKE_PAYLOAD *NotifyPayload; IKE_PAYLOAD *DeletePayload; IKE_PAYLOAD *IkePayload; IKEV2_DELETE *Delete; @@ -229,7 +229,6 @@ Ikev2InfoParser ( IkeSaSession = (IKEV2_SA_SESSION *) SaSession; - NotifyPayload = NULL; DeletePayload = NULL; Private = NULL; RespondPacket = NULL; diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c b/NetworkPkg/IpSecDxe/Ikev2/Payload.c index 012e8c2..32a23e2 100644 --- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c +++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c @@ -1,6 +1,7 @@ /** @file The implementation of Payloads Creation. + (C) Copyright 2014 - 2015 Hewlett-Packard Development Company, + L.P.<BR> Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -284,7 +285,6 @@ Ikev2GenerateCertIdPayload ( IKE_PAYLOAD *IdPayload; IKEV2_ID *Id; UINTN IdSize; - UINT8 IpVersion; UINTN SubjectSize; UINT8 *CertSubject; @@ -304,7 +304,6 @@ Ikev2GenerateCertIdPayload ( SubjectSize = 0; CertSubject = NULL; - IpVersion = CommonSession->UdpService->IpVersion; IpSecCryptoIoGetSubjectFromCert ( InCert, CertSize, @@ -615,7 +614,6 @@ Ikev2CertGenerateAuthPayload ( UINTN DigestSize; PRF_DATA_FRAGMENT Fragments[3]; UINT8 *KeyBuf; - UINTN KeySize; IKE_PAYLOAD *AuthPayload; IKEV2_AUTH *PayloadBuf; EFI_STATUS Status; @@ -663,7 +661,6 @@ Ikev2CertGenerateAuthPayload ( ASSERT (KeyBuf != NULL); CopyMem (KeyBuf, Digest, DigestSize); - KeySize = DigestSize; // // Calculate Prf(SK_Pi/r, IDi/r) @@ -2558,14 +2555,12 @@ Ikev2DecryptPacket ( IKEV2_CHILD_SA_SESSION *ChildSaSession; EFI_STATUS Status; UINT8 PadLen; - UINTN CryptKeyLength; HASH_DATA_FRAGMENT Fragments[1]; IvSize = 0; IkeSaSession = NULL; CryptBlockSize = 0; CheckSumSize = 0; - CryptKeyLength = 0; // // Check if the first payload is the Encrypted payload @@ -2583,7 +2578,6 @@ Ikev2DecryptPacket ( if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) { CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId); - CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId); IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon); @@ -2592,7 +2586,6 @@ Ikev2DecryptPacket ( ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon); IkeSaSession = ChildSaSession->IkeSaSession; CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); - CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId); } else { // @@ -2768,7 +2761,6 @@ Ikev2EncryptPacket ( UINT8 *EncryptPayloadBuf; // Contain whole Encrypted Payload UINTN EncryptPayloadSize; // Total size of the Encrypted payload UINT8 *IntegrityBuf; // Buffer to be intergity - UINT32 IntegrityBufSize; // Buffer size of IntegrityBuf UINT8 *IvBuffer; // Initialization Vector UINT8 IvSize; // Iv Size UINT8 CheckSumSize; // Integrity Check Sum Size depends on intergrity Auth @@ -2780,7 +2772,6 @@ Ikev2EncryptPacket ( EFI_STATUS Status; LIST_ENTRY *Entry; IKE_PAYLOAD *IkePayload; - UINTN CryptKeyLength; HASH_DATA_FRAGMENT Fragments[1]; Status = EFI_SUCCESS; @@ -2795,7 +2786,6 @@ Ikev2EncryptPacket ( IkeSaSession = NULL; CryptBlockSize = 0; CheckSumSize = 0; - CryptKeyLength = 0; IntegrityBuf = NULL; // // Get the Block Size @@ -2803,7 +2793,6 @@ Ikev2EncryptPacket ( if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) { CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId); - CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId); IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon); @@ -2812,7 +2801,6 @@ Ikev2EncryptPacket ( ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon); IkeSaSession = ChildSaSession->IkeSaSession; CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); - CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId); } @@ -2919,7 +2907,6 @@ Ikev2EncryptPacket ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - IntegrityBufSize = IkePacket->Header->Length; IkeHdrHostToNet (IkePacket->Header); CopyMem (IntegrityBuf, IkePacket->Header, sizeof (IKE_HEADER)); diff --git a/NetworkPkg/IpSecDxe/Ikev2/Sa.c b/NetworkPkg/IpSecDxe/Ikev2/Sa.c index ae13e4d..9482a60 100644 --- a/NetworkPkg/IpSecDxe/Ikev2/Sa.c +++ b/NetworkPkg/IpSecDxe/Ikev2/Sa.c @@ -1,6 +1,7 @@ /** @file The operations for IKEv2 SA. + (C) Copyright 2014 - 2015 Hewlett-Packard Development Company, + L.P.<BR> Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -1132,7 +1133,6 @@ Ikev2AuthCertParser ( IKE_PAYLOAD *TsiPayload; IKE_PAYLOAD *TsrPayload; IKE_PAYLOAD *CertPayload; - IKE_PAYLOAD *CertReqPayload; IKE_PAYLOAD *VerifiedAuthPayload; LIST_ENTRY *Entry; EFI_STATUS Status; @@ -1151,7 +1151,6 @@ Ikev2AuthCertParser ( TsiPayload = NULL; TsrPayload = NULL; CertPayload = NULL; - CertReqPayload = NULL; VerifiedAuthPayload = NULL; Status = EFI_INVALID_PARAMETER; @@ -1184,7 +1183,6 @@ Ikev2AuthCertParser ( CertPayload = IkePayload; } if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERTREQ) { - CertReqPayload = IkePayload; } } @@ -1478,7 +1476,6 @@ Ikev2GenerateSaKeys ( { EFI_STATUS Status; IKEV2_SA_PARAMS *SaParams; - IPSEC_PAD_ENTRY *Pad; PRF_DATA_FRAGMENT Fragments[4]; UINT64 InitiatorCookieNet; UINT64 ResponderCookieNet; @@ -1503,7 +1500,6 @@ Ikev2GenerateSaKeys ( // Ikev2GenerateSaDhComputeKey (IkeSaSession->IkeKeys->DhBuffer, KePayload); - Pad = IkeSaSession->Pad; // // Get the key length of Authenticaion, Encryption, PRF, and Integrity. diff --git a/NetworkPkg/IpSecDxe/Ikev2/Utility.c b/NetworkPkg/IpSecDxe/Ikev2/Utility.c index cb436b6..0ac65d9 100644 --- a/NetworkPkg/IpSecDxe/Ikev2/Utility.c +++ b/NetworkPkg/IpSecDxe/Ikev2/Utility.c @@ -1,6 +1,7 @@ /** @file The Common operations used by IKE Exchange Process. + (C) Copyright 2014 - 2015 Hewlett-Packard Development Company, + L.P.<BR> Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -571,7 +572,6 @@ Ikev2ChildSaSessionReg ( IKEV2_SESSION_COMMON *SessionCommon; IKEV2_CHILD_SA_SESSION *OldChildSaSession; IKEV2_SA_SESSION *IkeSaSession; - IKEV2_SA_PARAMS *SaParams; EFI_STATUS Status; UINT64 Lifetime; @@ -624,7 +624,6 @@ Ikev2ChildSaSessionReg ( // // Start to count the lifetime of the IKE SA. // - SaParams = SessionCommon->SaParams; if (ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime != 0){ Lifetime = ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime; } else { diff --git a/NetworkPkg/IpSecDxe/IpSecImpl.c b/NetworkPkg/IpSecDxe/IpSecImpl.c index 347bdd9..8f4df95 100644 --- a/NetworkPkg/IpSecDxe/IpSecImpl.c +++ b/NetworkPkg/IpSecDxe/IpSecImpl.c @@ -1,6 +1,7 @@ /** @file The implementation of IPsec. + (C) Copyright 2014 - 2015 Hewlett-Packard Development Company, + L.P.<BR> Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials @@ -898,7 +899,6 @@ IpSecIsIp6ExtsValid ( UINT32 Pointer; UINT8 *Option; UINT8 OptionLen; - BOOLEAN Flag; UINT8 CountD; UINT8 CountF; UINT8 CountA; @@ -918,7 +918,6 @@ IpSecIsIp6ExtsValid ( } Pointer = 0; - Flag = FALSE; CountD = 0; CountF = 0; CountA = 0; @@ -931,7 +930,6 @@ IpSecIsIp6ExtsValid ( return FALSE; } - Flag = TRUE; // // Fall through -- 1.9.5.msysgit.0 ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel