diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2024-06-22 20:38:03 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-07-05 19:33:50 +0000 |
commit | 3be79ece37085f1037103e665e5df67b3a22b630 (patch) | |
tree | 7f26a6f817fac2ec13585588d24f218ad6573c18 /BaseTools | |
parent | 8e7bd66dc11300cedc520c841e1cc8303f6b4169 (diff) | |
download | edk2-3be79ece37085f1037103e665e5df67b3a22b630.tar.gz edk2-3be79ece37085f1037103e665e5df67b3a22b630.tar.bz2 edk2-3be79ece37085f1037103e665e5df67b3a22b630.zip |
BaseTools/GenerateCapsule.py: Disallow UpdateImageIndex == 0 on --encode
This field seems to be one-based according UEFI specification, default
value is 1 and --decode of GenerateCapsule.py errors upon seeing
UpdateImageIndex less than 1. So align --encode behaviour to enforce a
value within the 1..255 range.
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/Capsule/GenerateCapsule.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py index 9a395d0072..de1dbbab5f 100644 --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py @@ -513,11 +513,11 @@ if __name__ == '__main__': raise argparse.ArgumentTypeError ('JSON field MonotonicCount must be an integer in range 0x0..0xffffffffffffffff')
else:
raise argparse.ArgumentTypeError ('--monotonic-count must be an integer in range 0x0..0xffffffffffffffff')
- if self.UpdateImageIndex >0xFF:
+ if self.UpdateImageIndex < 0x1 or self.UpdateImageIndex > 0xFF:
if args.JsonFile:
- raise argparse.ArgumentTypeError ('JSON field UpdateImageIndex must be an integer in range 0x0..0xff')
+ raise argparse.ArgumentTypeError ('JSON field UpdateImageIndex must be an integer in range 0x1..0xff')
else:
- raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x0..0xff')
+ raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x1..0xff')
if self.UseSignTool:
if self.SignToolPfxFile is not None:
|