Skip to content

Commit 69b8456

Browse files
authored
Merge pull request #90 from joshuagl/joshuagl/timestamp-length
Clarify timestamp.json METAFILES format
2 parents 4db06fc + 53f6ea3 commit 69b8456

File tree

1 file changed

+40
-33
lines changed

1 file changed

+40
-33
lines changed

tuf-spec.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# <p align="center">The Update Framework Specification
22

3-
Last modified: **5 March 2020**
3+
Last modified: **6 March 2020**
44

5-
Version: **1.0.0**
5+
Version: **1.0.1**
66

77
We strive to make the specification easy to implement, so if you come across
88
any inconsistencies or experience any difficulty, do let us know by sending an
@@ -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+
version of 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

@@ -1072,8 +1076,8 @@ repo](https://github.com/theupdateframework/specification/issues).
10721076
* **1.1**. Let N denote the version number of the trusted root metadata file.
10731077

10741078
* **1.2**. **Try downloading version N+1 of the root metadata file**, up to
1075-
some X number of bytes (because the size is unknown). The value for X is set
1076-
by the authors of the application using TUF. For example, X may be tens of
1079+
some W number of bytes (because the size is unknown). The value for W is set
1080+
by the authors of the application using TUF. For example, W may be tens of
10771081
kilobytes. The filename used to download the root metadata file is of the
10781082
fixed form VERSION_NUMBER.FILENAME.EXT (e.g., 42.root.json). If this file is
10791083
not available, or we have downloaded more than Y number of root metadata files
@@ -1125,9 +1129,9 @@ repo](https://github.com/theupdateframework/specification/issues).
11251129
* **1.10**. **Set whether consistent snapshots are used as per the trusted
11261130
root metadata file** (see Section 4.3).
11271131

1128-
**2**. **Download the timestamp metadata file**, up to Y number of bytes
1129-
(because the size is unknown.) The value for Y is set by the authors of the
1130-
application using TUF. For example, Y may be tens of kilobytes. The filename
1132+
**2**. **Download the timestamp metadata file**, up to X number of bytes
1133+
(because the size is unknown). The value for X is set by the authors of the
1134+
application using TUF. For example, X may be tens of kilobytes. The filename
11311135
used to download the timestamp metadata file is of the fixed form FILENAME.EXT
11321136
(e.g., timestamp.json). The client MUST write the file to non-volatile storage
11331137
as FILENAME.EXT.
@@ -1149,8 +1153,10 @@ as FILENAME.EXT.
11491153
file. If the new timestamp metadata file has expired, discard it, abort the
11501154
update cycle, and report the potential freeze attack.
11511155

1152-
**3**. **Download snapshot metadata file**, up to the number of bytes specified
1153-
in the timestamp metadata file. If consistent snapshots are not used (see
1156+
**3**. **Download snapshot metadata file**, up to either the number of bytes
1157+
specified in the timestamp metadata file, or some Y number of bytes. The value
1158+
for Y is set by the authors of the application using TUF. For example, Y may be
1159+
tens of kilobytes. If consistent snapshots are not used (see
11541160
Section 7), then the filename used to download the snapshot metadata file is of
11551161
the fixed form FILENAME.EXT (e.g., snapshot.json). Otherwise, the filename is
11561162
of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.snapshot.json), where
@@ -1159,10 +1165,10 @@ the timestamp metadata file. In either case, the client MUST write the file to
11591165
non-volatile storage as FILENAME.EXT.
11601166

11611167
* **3.1**. **Check against timestamp metadata.** The hashes and version
1162-
number of the new snapshot metadata file MUST match the hashes and version
1163-
number listed in timestamp metadata. If hashes and version do not match,
1164-
discard the new snapshot metadata, abort the update cycle, and report the
1165-
failure.
1168+
number of the new snapshot metadata file MUST match the hashes (if any) and
1169+
version number listed in the trusted timestamp metadata. If hashes and
1170+
version do not match, discard the new snapshot metadata, abort the update
1171+
cycle, and report the failure.
11661172

11671173
* **3.2**. **Check signatures.** The new snapshot metadata file MUST have
11681174
been signed by a threshold of keys specified in the trusted root metadata
@@ -1207,11 +1213,12 @@ VERSION_NUMBER is the version number of the targets metadata file listed in the
12071213
snapshot metadata file. In either case, the client MUST write the file to
12081214
non-volatile storage as FILENAME.EXT.
12091215

1210-
* **4.1**. **Check against snapshot metadata.** The hashes (if any), and
1211-
version number of the new targets metadata file MUST match the trusted
1212-
snapshot metadata. This is done, in part, to prevent a mix-and-match attack
1213-
by man-in-the-middle attackers. If the new targets metadata file does not
1214-
match, discard it, abort the update cycle, and report the failure.
1216+
* **4.1**. **Check against snapshot metadata.** The hashes and version
1217+
number of the new targets metadata file MUST match the hashes (if any) and
1218+
version number listed in the trusted snapshot metadata. This is done, in
1219+
part, to prevent a mix-and-match attack by man-in-the-middle attackers. If
1220+
the new targets metadata file does not match, discard it, abort the update
1221+
cycle, and report the failure.
12151222

12161223
* **4.2**. **Check for an arbitrary software attack.** The new targets
12171224
metadata file MUST have been signed by a threshold of keys specified in the

0 commit comments

Comments
 (0)