diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2024-06-22 20:47:56 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-07-05 19:33:50 +0000 |
commit | 26bc42f1e34cdf43057a75b8edcc0bd86c091214 (patch) | |
tree | 30cfed3887f985a617c7e7495e29133b795ee062 /BaseTools | |
parent | eeddb86aaaadcf5e716741db54af08531e25ff62 (diff) | |
download | edk2-26bc42f1e34cdf43057a75b8edcc0bd86c091214.tar.gz edk2-26bc42f1e34cdf43057a75b8edcc0bd86c091214.tar.bz2 edk2-26bc42f1e34cdf43057a75b8edcc0bd86c091214.zip |
BaseTools/GenerateCapsule.py: Fix checking for DepExp presence
struct.unpack() returns a tuple even for a single-element pack,
resulting in signature verification being evaluated to false even when
the signature is there.
This fixes --decode and --dump-info actions incorrectly reporting issues
with parsing capsule dependencies when there are none.
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/Capsule/GenerateCapsule.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py index d694130bc4..a773cfb2b3 100644 --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py @@ -831,7 +831,7 @@ if __name__ == '__main__': print ('--------')
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
- PayloadSignature = struct.unpack ('<I', SinglePayloadDescriptor.Payload[0:4])
+ (PayloadSignature,) = struct.unpack ('<I', SinglePayloadDescriptor.Payload[0:4])
if PayloadSignature != FmpPayloadHeader.Signature:
SinglePayloadDescriptor.UseDependency = True
try:
@@ -918,7 +918,7 @@ if __name__ == '__main__': print ('--------')
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
- PayloadSignature = struct.unpack ('<I', Result[0:4])
+ (PayloadSignature,) = struct.unpack ('<I', Result[0:4])
if PayloadSignature != FmpPayloadHeader.Signature:
try:
Result = CapsuleDependency.Decode (Result)
|