verify data signed using PKCS7 structure. The PKCS7 data to be verified must\r
be ASN.1 (DER) encoded.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
IN OUT UINTN *ContentSize\r
)\r
{\r
- EFI_STATUS Status;\r
- UINT8 *AttachedData;\r
- UINTN AttachedDataSize;\r
- UINT8 *DataPtr;\r
- UINTN DataSize;\r
+ EFI_STATUS Status;\r
+ EFI_SIGNATURE_LIST *SigList;\r
+ UINTN Index;\r
+ UINT8 *AttachedData;\r
+ UINTN AttachedDataSize;\r
+ UINT8 *DataPtr;\r
+ UINTN DataSize;\r
\r
//\r
// Parameters Checking\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ //\r
+ // Check if any invalid entry format in AllowedDb list contents\r
+ //\r
+ for (Index = 0; ; Index++) {\r
+ SigList = (EFI_SIGNATURE_LIST *)(AllowedDb[Index]);\r
+\r
+ if (SigList == NULL) {\r
+ break;\r
+ }\r
+ if (SigList->SignatureListSize < sizeof (EFI_SIGNATURE_LIST) +\r
+ SigList->SignatureHeaderSize +\r
+ SigList->SignatureSize) {\r
+ return EFI_ABORTED;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Check if any invalid entry format in RevokedDb list contents\r
+ //\r
+ if (RevokedDb != NULL) {\r
+ for (Index = 0; ; Index++) {\r
+ SigList = (EFI_SIGNATURE_LIST *)(RevokedDb[Index]);\r
+\r
+ if (SigList == NULL) {\r
+ break;\r
+ }\r
+ if (SigList->SignatureListSize < sizeof (EFI_SIGNATURE_LIST) +\r
+ SigList->SignatureHeaderSize +\r
+ SigList->SignatureSize) {\r
+ return EFI_ABORTED;\r
+ }\r
+ }\r
+ }\r
+\r
+ //\r
+ // Check if any invalid entry format in TimeStampDb list contents\r
+ //\r
+ if (TimeStampDb != NULL) {\r
+ for (Index = 0; ; Index++) {\r
+ SigList = (EFI_SIGNATURE_LIST *)(TimeStampDb[Index]);\r
+\r
+ if (SigList == NULL) {\r
+ break;\r
+ }\r
+ if (SigList->SignatureListSize < sizeof (EFI_SIGNATURE_LIST) +\r
+ SigList->SignatureHeaderSize +\r
+ SigList->SignatureSize) {\r
+ return EFI_ABORTED;\r
+ }\r
+ }\r
+ }\r
+\r
//\r
// Try to retrieve the attached content from PKCS7 signedData\r
//\r