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-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
This commit is contained in:
Samer El-Haj-Mahmoud 2015-07-01 03:35:32 +00:00 committed by sfu5
parent 7ae77cee96
commit e8837eddf3
5 changed files with 6 additions and 30 deletions

View File

@ -1,6 +1,7 @@
/** @file /** @file
The Implementations for Information Exchange. The Implementations for Information Exchange.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -211,7 +212,6 @@ Ikev2InfoParser (
{ {
IKEV2_CHILD_SA_SESSION *ChildSaSession; IKEV2_CHILD_SA_SESSION *ChildSaSession;
IKEV2_SA_SESSION *IkeSaSession; IKEV2_SA_SESSION *IkeSaSession;
IKE_PAYLOAD *NotifyPayload;
IKE_PAYLOAD *DeletePayload; IKE_PAYLOAD *DeletePayload;
IKE_PAYLOAD *IkePayload; IKE_PAYLOAD *IkePayload;
IKEV2_DELETE *Delete; IKEV2_DELETE *Delete;
@ -229,7 +229,6 @@ Ikev2InfoParser (
IkeSaSession = (IKEV2_SA_SESSION *) SaSession; IkeSaSession = (IKEV2_SA_SESSION *) SaSession;
NotifyPayload = NULL;
DeletePayload = NULL; DeletePayload = NULL;
Private = NULL; Private = NULL;
RespondPacket = NULL; RespondPacket = NULL;

View File

@ -1,6 +1,7 @@
/** @file /** @file
The implementation of Payloads Creation. The implementation of Payloads Creation.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -284,7 +285,6 @@ Ikev2GenerateCertIdPayload (
IKE_PAYLOAD *IdPayload; IKE_PAYLOAD *IdPayload;
IKEV2_ID *Id; IKEV2_ID *Id;
UINTN IdSize; UINTN IdSize;
UINT8 IpVersion;
UINTN SubjectSize; UINTN SubjectSize;
UINT8 *CertSubject; UINT8 *CertSubject;
@ -304,7 +304,6 @@ Ikev2GenerateCertIdPayload (
SubjectSize = 0; SubjectSize = 0;
CertSubject = NULL; CertSubject = NULL;
IpVersion = CommonSession->UdpService->IpVersion;
IpSecCryptoIoGetSubjectFromCert ( IpSecCryptoIoGetSubjectFromCert (
InCert, InCert,
CertSize, CertSize,
@ -615,7 +614,6 @@ Ikev2CertGenerateAuthPayload (
UINTN DigestSize; UINTN DigestSize;
PRF_DATA_FRAGMENT Fragments[3]; PRF_DATA_FRAGMENT Fragments[3];
UINT8 *KeyBuf; UINT8 *KeyBuf;
UINTN KeySize;
IKE_PAYLOAD *AuthPayload; IKE_PAYLOAD *AuthPayload;
IKEV2_AUTH *PayloadBuf; IKEV2_AUTH *PayloadBuf;
EFI_STATUS Status; EFI_STATUS Status;
@ -663,7 +661,6 @@ Ikev2CertGenerateAuthPayload (
ASSERT (KeyBuf != NULL); ASSERT (KeyBuf != NULL);
CopyMem (KeyBuf, Digest, DigestSize); CopyMem (KeyBuf, Digest, DigestSize);
KeySize = DigestSize;
// //
// Calculate Prf(SK_Pi/r, IDi/r) // Calculate Prf(SK_Pi/r, IDi/r)
@ -2558,14 +2555,12 @@ Ikev2DecryptPacket (
IKEV2_CHILD_SA_SESSION *ChildSaSession; IKEV2_CHILD_SA_SESSION *ChildSaSession;
EFI_STATUS Status; EFI_STATUS Status;
UINT8 PadLen; UINT8 PadLen;
UINTN CryptKeyLength;
HASH_DATA_FRAGMENT Fragments[1]; HASH_DATA_FRAGMENT Fragments[1];
IvSize = 0; IvSize = 0;
IkeSaSession = NULL; IkeSaSession = NULL;
CryptBlockSize = 0; CryptBlockSize = 0;
CheckSumSize = 0; CheckSumSize = 0;
CryptKeyLength = 0;
// //
// Check if the first payload is the Encrypted payload // Check if the first payload is the Encrypted payload
@ -2583,7 +2578,7 @@ Ikev2DecryptPacket (
if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) { if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) {
CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId); CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId);
CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId);
CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId);
IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon); IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon);
@ -2592,7 +2587,6 @@ Ikev2DecryptPacket (
ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon); ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon);
IkeSaSession = ChildSaSession->IkeSaSession; IkeSaSession = ChildSaSession->IkeSaSession;
CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);
CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);
CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId);
} else { } else {
// //
@ -2768,7 +2762,6 @@ Ikev2EncryptPacket (
UINT8 *EncryptPayloadBuf; // Contain whole Encrypted Payload UINT8 *EncryptPayloadBuf; // Contain whole Encrypted Payload
UINTN EncryptPayloadSize; // Total size of the Encrypted payload UINTN EncryptPayloadSize; // Total size of the Encrypted payload
UINT8 *IntegrityBuf; // Buffer to be intergity UINT8 *IntegrityBuf; // Buffer to be intergity
UINT32 IntegrityBufSize; // Buffer size of IntegrityBuf
UINT8 *IvBuffer; // Initialization Vector UINT8 *IvBuffer; // Initialization Vector
UINT8 IvSize; // Iv Size UINT8 IvSize; // Iv Size
UINT8 CheckSumSize; // Integrity Check Sum Size depends on intergrity Auth UINT8 CheckSumSize; // Integrity Check Sum Size depends on intergrity Auth
@ -2780,7 +2773,6 @@ Ikev2EncryptPacket (
EFI_STATUS Status; EFI_STATUS Status;
LIST_ENTRY *Entry; LIST_ENTRY *Entry;
IKE_PAYLOAD *IkePayload; IKE_PAYLOAD *IkePayload;
UINTN CryptKeyLength;
HASH_DATA_FRAGMENT Fragments[1]; HASH_DATA_FRAGMENT Fragments[1];
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
@ -2795,7 +2787,6 @@ Ikev2EncryptPacket (
IkeSaSession = NULL; IkeSaSession = NULL;
CryptBlockSize = 0; CryptBlockSize = 0;
CheckSumSize = 0; CheckSumSize = 0;
CryptKeyLength = 0;
IntegrityBuf = NULL; IntegrityBuf = NULL;
// //
// Get the Block Size // Get the Block Size
@ -2803,7 +2794,6 @@ Ikev2EncryptPacket (
if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) { if (SessionCommon->IkeSessionType == IkeSessionTypeIkeSa) {
CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId); CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) SessionCommon->SaParams->EncAlgId);
CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) SessionCommon->SaParams->EncAlgId);
CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) SessionCommon->SaParams->IntegAlgId);
IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon); IkeSaSession = IKEV2_SA_SESSION_FROM_COMMON (SessionCommon);
@ -2812,7 +2802,6 @@ Ikev2EncryptPacket (
ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon); ChildSaSession = IKEV2_CHILD_SA_SESSION_FROM_COMMON (SessionCommon);
IkeSaSession = ChildSaSession->IkeSaSession; IkeSaSession = ChildSaSession->IkeSaSession;
CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId); CryptBlockSize = (UINT8) IpSecGetEncryptBlockSize ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);
CryptKeyLength = IpSecGetEncryptKeyLength ((UINT8) IkeSaSession->SessionCommon.SaParams->EncAlgId);
CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId); CheckSumSize = (UINT8) IpSecGetIcvLength ((UINT8) IkeSaSession->SessionCommon.SaParams->IntegAlgId);
} }
@ -2919,7 +2908,6 @@ Ikev2EncryptPacket (
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT; goto ON_EXIT;
} }
IntegrityBufSize = IkePacket->Header->Length;
IkeHdrHostToNet (IkePacket->Header); IkeHdrHostToNet (IkePacket->Header);
CopyMem (IntegrityBuf, IkePacket->Header, sizeof (IKE_HEADER)); CopyMem (IntegrityBuf, IkePacket->Header, sizeof (IKE_HEADER));

View File

@ -1,6 +1,7 @@
/** @file /** @file
The operations for IKEv2 SA. The operations for IKEv2 SA.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -1132,7 +1133,6 @@ Ikev2AuthCertParser (
IKE_PAYLOAD *TsiPayload; IKE_PAYLOAD *TsiPayload;
IKE_PAYLOAD *TsrPayload; IKE_PAYLOAD *TsrPayload;
IKE_PAYLOAD *CertPayload; IKE_PAYLOAD *CertPayload;
IKE_PAYLOAD *CertReqPayload;
IKE_PAYLOAD *VerifiedAuthPayload; IKE_PAYLOAD *VerifiedAuthPayload;
LIST_ENTRY *Entry; LIST_ENTRY *Entry;
EFI_STATUS Status; EFI_STATUS Status;
@ -1151,7 +1151,6 @@ Ikev2AuthCertParser (
TsiPayload = NULL; TsiPayload = NULL;
TsrPayload = NULL; TsrPayload = NULL;
CertPayload = NULL; CertPayload = NULL;
CertReqPayload = NULL;
VerifiedAuthPayload = NULL; VerifiedAuthPayload = NULL;
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
@ -1183,9 +1182,6 @@ Ikev2AuthCertParser (
if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERT) { if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERT) {
CertPayload = IkePayload; CertPayload = IkePayload;
} }
if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_CERTREQ) {
CertReqPayload = IkePayload;
}
} }
if ((SaPayload == NULL) || (AuthPayload == NULL) || (TsiPayload == NULL) || if ((SaPayload == NULL) || (AuthPayload == NULL) || (TsiPayload == NULL) ||
@ -1478,7 +1474,6 @@ Ikev2GenerateSaKeys (
{ {
EFI_STATUS Status; EFI_STATUS Status;
IKEV2_SA_PARAMS *SaParams; IKEV2_SA_PARAMS *SaParams;
IPSEC_PAD_ENTRY *Pad;
PRF_DATA_FRAGMENT Fragments[4]; PRF_DATA_FRAGMENT Fragments[4];
UINT64 InitiatorCookieNet; UINT64 InitiatorCookieNet;
UINT64 ResponderCookieNet; UINT64 ResponderCookieNet;
@ -1503,8 +1498,6 @@ Ikev2GenerateSaKeys (
// //
Ikev2GenerateSaDhComputeKey (IkeSaSession->IkeKeys->DhBuffer, KePayload); Ikev2GenerateSaDhComputeKey (IkeSaSession->IkeKeys->DhBuffer, KePayload);
Pad = IkeSaSession->Pad;
// //
// Get the key length of Authenticaion, Encryption, PRF, and Integrity. // Get the key length of Authenticaion, Encryption, PRF, and Integrity.
// //

View File

@ -1,6 +1,7 @@
/** @file /** @file
The Common operations used by IKE Exchange Process. The Common operations used by IKE Exchange Process.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -571,7 +572,6 @@ Ikev2ChildSaSessionReg (
IKEV2_SESSION_COMMON *SessionCommon; IKEV2_SESSION_COMMON *SessionCommon;
IKEV2_CHILD_SA_SESSION *OldChildSaSession; IKEV2_CHILD_SA_SESSION *OldChildSaSession;
IKEV2_SA_SESSION *IkeSaSession; IKEV2_SA_SESSION *IkeSaSession;
IKEV2_SA_PARAMS *SaParams;
EFI_STATUS Status; EFI_STATUS Status;
UINT64 Lifetime; UINT64 Lifetime;
@ -624,7 +624,6 @@ Ikev2ChildSaSessionReg (
// //
// Start to count the lifetime of the IKE SA. // Start to count the lifetime of the IKE SA.
// //
SaParams = SessionCommon->SaParams;
if (ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime != 0){ if (ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime != 0){
Lifetime = ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime; Lifetime = ChildSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime;
} else { } else {

View File

@ -1,6 +1,7 @@
/** @file /** @file
The implementation of IPsec. The implementation of IPsec.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -898,7 +899,6 @@ IpSecIsIp6ExtsValid (
UINT32 Pointer; UINT32 Pointer;
UINT8 *Option; UINT8 *Option;
UINT8 OptionLen; UINT8 OptionLen;
BOOLEAN Flag;
UINT8 CountD; UINT8 CountD;
UINT8 CountF; UINT8 CountF;
UINT8 CountA; UINT8 CountA;
@ -918,7 +918,6 @@ IpSecIsIp6ExtsValid (
} }
Pointer = 0; Pointer = 0;
Flag = FALSE;
CountD = 0; CountD = 0;
CountF = 0; CountF = 0;
CountA = 0; CountA = 0;
@ -931,8 +930,6 @@ IpSecIsIp6ExtsValid (
return FALSE; return FALSE;
} }
Flag = TRUE;
// //
// Fall through // Fall through
// //