Skip to content

Commit 7299f91

Browse files
committed
[ot] scripts/opentitan: allow image manifest major version 2
The only difference is that the signature is ECDSA, but the layout hasn't changed and we don't care about the actual value of the signature.
1 parent 9fd4845 commit 7299f91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/opentitan/flashgen.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class FlashGen:
128128
MANIFEST_SIZE = 1024
129129
MANIFEST_VERSION_MINOR1 = 0x6c47
130130
MANIFEST_VERSION_MAJOR1 = 0x71c3
131+
# Allow v2 manifests, the only difference is that signatures are ECDSA.
132+
MANIFEST_VERSION_MAJOR2 = 0x0002
131133
MANIFEST_EXT_TABLE_COUNT = 15
132134

133135
MANIFEST_TRUE = 0x739 # 'true' value for address_translation field
@@ -566,8 +568,8 @@ def _check_manifest(self, data: bytes, kind: str, max_size: int) \
566568
manifest = dict(zip(self.MANIFEST_FORMAT,
567569
sunpack(f'<{mfmt}', data[:slen])))
568570
self._log_manifest(manifest)
569-
if (manifest['manifest_version_major'] !=
570-
self.MANIFEST_VERSION_MAJOR1
571+
if (manifest['manifest_version_major'] not in
572+
(self.MANIFEST_VERSION_MAJOR1, self.MANIFEST_VERSION_MAJOR2)
571573
or manifest['manifest_version_minor'] !=
572574
self.MANIFEST_VERSION_MINOR1):
573575
raise ValueError('Unsupported manifest version')

0 commit comments

Comments
 (0)