Skip to content

Commit a5848e7

Browse files
committed
Clarify snapshot and timestamp METAFILES
Generally clarify what files are listed under METAFILES in snapshot.json and timestamp.json and under what circumstances the LENGTH and HASHES field for a METAFILE can be omitted (and why it should be omitted).
1 parent e53f11c commit a5848e7

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

tuf-spec.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,9 @@ repo](https://github.com/theupdateframework/specification/issues).
709709

710710
* **4.4. File formats: snapshot.json**
711711

712-
The snapshot.json file is signed by the snapshot role. It lists the version
713-
numbers of only the top-level targets and all delegated targets role metadata.
714-
The metadata length and hashes are OPTIONAL for the top-level targets and
715-
all delegated targets roles.
712+
The snapshot.json file is signed by the snapshot role. It MUST list the
713+
version numbers of the top-level targets metadata and all delegated targets
714+
metadata. It MAY also list their lengths and file hashes.
716715

717716
The "signed" portion of snapshot.json is as follows:
718717

@@ -732,18 +731,23 @@ repo](https://github.com/theupdateframework/specification/issues).
732731
, ...
733732
}
734733

735-
METAPATH is the metadata file's path on the repository relative to the
736-
metadata base URL.
734+
METAPATH is the file path of the metadata on the repository relative to the
735+
metadata base URL. For snapshot.json, these are top-level targets metadata
736+
and delegated targets metadata.
737737

738-
VERSION is listed for the top-level targets and all delegated targets roles
739-
available on the repository.
738+
VERSION is the integer version number as shown in the metadata file at
739+
METAPATH.
740740

741-
LENGTH is the integer length in bytes of the metadata file. It is
742-
OPTIONAL for all roles.
741+
LENGTH is the integer length in bytes of the metadata file at METAPATH. It
742+
is OPTIONAL and can be omitted to reduce the snapshot metadata file size. In
743+
that case the client MUST use a custom download limit for the listed
744+
metadata.
743745

744-
HASHES is the dictionary that specifies one or more hashes, including
745-
the cryptographic hash function. For example: { "sha256": HASH, ... }. It is
746-
OPTIONAL for all roles.
746+
HASHES is a dictionary that specifies one or more hashes of the metadata
747+
file at METAPATH, including their cryptographic hash function. For example:
748+
{ "sha256": HASH, ... }. HASHES is OPTIONAL and can be omitted to reduce
749+
the snapshot metadata file size. In that case the repository MUST guarantee
750+
that VERSION alone unambiguously identifies the metadata at METAPATH.
747751

748752
A snapshot.json example file:
749753

@@ -958,8 +962,8 @@ repo](https://github.com/theupdateframework/specification/issues).
958962

959963
* **4.6. File formats: timestamp.json**
960964

961-
The timestamp file is signed by a timestamp key. It indicates the
962-
latest versions of other files and is frequently resigned to limit the
965+
The timestamp file is signed by a timestamp key. It indicates the latest
966+
versions the snapshot metadata and is frequently resigned to limit the
963967
amount of time a client can be kept unaware of interference with obtaining
964968
updates.
965969

0 commit comments

Comments
 (0)