diff options
Diffstat (limited to 'BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py')
-rw-r--r-- | BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py index 4b8c6da26a..48c605faa8 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py @@ -2,7 +2,7 @@ # Module that encodes and decodes a EFI_FIRMWARE_IMAGE_AUTHENTICATION with
# certificate data and payload data.
#
-# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -166,6 +166,18 @@ class FmpAuthHeaderClass (object): self._Valid = True
return self.Payload
+ def IsSigned (self, Buffer):
+ if len (Buffer) < self._StructSize:
+ return False
+ (MonotonicCount, dwLength, wRevision, wCertificateType, CertType) = \
+ struct.unpack (
+ self._StructFormat,
+ Buffer[0:self._StructSize]
+ )
+ if CertType != self._EFI_CERT_TYPE_PKCS7_GUID.bytes_le:
+ return False
+ return True
+
def DumpInfo (self):
if not self._Valid:
raise ValueError
|