Fixes buffer read overflow bugs in authenticated variable driver.

Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13298 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
sfu5 2012-05-09 10:45:09 +00:00
parent 568e7b2777
commit 4e33001c6e
1 changed files with 5 additions and 2 deletions

View File

@ -1399,6 +1399,9 @@ ProcessVariable (
// Update public key database variable if need.
//
KeyIndex = AddPubKeyInStore (PubKey);
if (KeyIndex == 0) {
return EFI_SECURITY_VIOLATION;
}
}
//
@ -2179,7 +2182,7 @@ VerifyTimeBasedPayload (
CertList = (EFI_SIGNATURE_LIST *) GetVariableDataPtr (PkVariable.CurrPtr);
Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) CertList + sizeof (EFI_SIGNATURE_LIST) + CertList->SignatureHeaderSize);
RootCert = Cert->SignatureData;
RootCertSize = CertList->SignatureSize;
RootCertSize = CertList->SignatureSize - (sizeof (EFI_SIGNATURE_DATA) - 1);
//
@ -2224,7 +2227,7 @@ VerifyTimeBasedPayload (
// Iterate each Signature Data Node within this CertList for a verify
//
RootCert = Cert->SignatureData;
RootCertSize = CertList->SignatureSize;
RootCertSize = CertList->SignatureSize - (sizeof (EFI_SIGNATURE_DATA) - 1);
//
// Verify Pkcs7 SignedData via Pkcs7Verify library.