Skip to content

Commit 1ca55bf

Browse files
authored
Merge pull request #116 from erickt/persist
Persist metadata to local store after validation
2 parents d4c2f4b + f9a8dd0 commit 1ca55bf

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

tuf-spec.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Last modified: **29 September 2020**
44

5-
Version: **1.0.7**
5+
Version: **1.0.8**
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
@@ -1121,15 +1121,18 @@ repo](https://github.com/theupdateframework/specification/issues).
11211121
* **1.6**. **Set the trusted root metadata file** to the new root metadata
11221122
file.
11231123

1124-
* **1.7**. **Repeat steps 1.1 to 1.7**.
1124+
* **1.7**. **Persist root metadata.** The client MUST write the file to
1125+
non-volatile storage as FILENAME.EXT (e.g. root.json).
11251126

1126-
* **1.8**. **Check for a freeze attack.** The latest known time should be
1127+
* **1.8**. **Repeat steps 1.1 to 1.8**.
1128+
1129+
* **1.9**. **Check for a freeze attack.** The latest known time should be
11271130
lower than the expiration timestamp in the trusted root metadata file
11281131
(version N). If the trusted root metadata file has expired, abort the update
11291132
cycle, report the potential freeze attack. On the next update cycle, begin
11301133
at step 0 and version N of the root metadata file.
11311134

1132-
* **1.9**. **If the timestamp and / or snapshot keys have been rotated, then
1135+
* **1.10**. **If the timestamp and / or snapshot keys have been rotated, then
11331136
delete the trusted timestamp and snapshot metadata files.** This is done in
11341137
order to recover from fast-forward attacks after the repository has been
11351138
compromised and recovered. A _fast-forward attack_ happens when attackers
@@ -1139,15 +1142,14 @@ repo](https://github.com/theupdateframework/specification/issues).
11391142
paper](https://ssl.engineering.nyu.edu/papers/kuppusamy-mercury-usenix-2017.pdf)
11401143
for more details.
11411144

1142-
* **1.10**. **Set whether consistent snapshots are used as per the trusted
1145+
* **1.11**. **Set whether consistent snapshots are used as per the trusted
11431146
root metadata file** (see Section 4.3).
11441147

11451148
**2**. **Download the timestamp metadata file**, up to X number of bytes
11461149
(because the size is unknown). The value for X is set by the authors of the
11471150
application using TUF. For example, X may be tens of kilobytes. The filename
11481151
used to download the timestamp metadata file is of the fixed form FILENAME.EXT
1149-
(e.g., timestamp.json). The client MUST write the file to non-volatile storage
1150-
as FILENAME.EXT.
1152+
(e.g., timestamp.json).
11511153

11521154
* **2.1**. **Check signatures.** The new timestamp metadata file must have
11531155
been signed by a threshold of keys specified in the trusted root metadata
@@ -1173,6 +1175,9 @@ as FILENAME.EXT.
11731175
file. If the new timestamp metadata file has expired, discard it, abort the
11741176
update cycle, and report the potential freeze attack.
11751177

1178+
* **2.4**. **Persist timestamp metadata.** The client MUST write the file to
1179+
non-volatile storage as FILENAME.EXT (e.g. timestamp.json).
1180+
11761181
**3**. **Download snapshot metadata file**, up to either the number of bytes
11771182
specified in the timestamp metadata file, or some Y number of bytes. The value
11781183
for Y is set by the authors of the application using TUF. For example, Y may be
@@ -1181,8 +1186,7 @@ Section 7), then the filename used to download the snapshot metadata file is of
11811186
the fixed form FILENAME.EXT (e.g., snapshot.json). Otherwise, the filename is
11821187
of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.snapshot.json), where
11831188
VERSION_NUMBER is the version number of the snapshot metadata file listed in
1184-
the timestamp metadata file. In either case, the client MUST write the file to
1185-
non-volatile storage as FILENAME.EXT.
1189+
the timestamp metadata file.
11861190

11871191
* **3.1**. **Check against timestamp metadata.** The hashes and version
11881192
number of the new snapshot metadata file MUST match the hashes (if any) and
@@ -1210,6 +1214,9 @@ non-volatile storage as FILENAME.EXT.
12101214
file. If the new snapshot metadata file is expired, discard it, abort the
12111215
update cycle, and report the potential freeze attack.
12121216

1217+
* **3.5**. **Persist snapshot metadata.** The client MUST write the file to
1218+
non-volatile storage as FILENAME.EXT (e.g. snapshot.json).
1219+
12131220
**4**. **Download the top-level targets metadata file**, up to either the
12141221
number of bytes specified in the snapshot metadata file, or some Z number of
12151222
bytes. The value for Z is set by the authors of the application using TUF. For
@@ -1218,8 +1225,7 @@ Section 7), then the filename used to download the targets metadata file is of
12181225
the fixed form FILENAME.EXT (e.g., targets.json). Otherwise, the filename is
12191226
of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.targets.json), where
12201227
VERSION_NUMBER is the version number of the targets metadata file listed in the
1221-
snapshot metadata file. In either case, the client MUST write the file to
1222-
non-volatile storage as FILENAME.EXT.
1228+
snapshot metadata file.
12231229

12241230
* **4.1**. **Check against snapshot metadata.** The hashes and version
12251231
number of the new targets metadata file MUST match the hashes (if any) and
@@ -1239,30 +1245,33 @@ non-volatile storage as FILENAME.EXT.
12391245
the new targets metadata file is expired, discard it, abort the update cycle,
12401246
and report the potential freeze attack.
12411247

1242-
* **4.4**. **Perform a preorder depth-first search for metadata about the
1248+
* **4.4**. **Persist targets metadata.** The client MUST write the file to
1249+
non-volatile storage as FILENAME.EXT (e.g. targets.json).
1250+
1251+
* **4.5**. **Perform a preorder depth-first search for metadata about the
12431252
desired target, beginning with the top-level targets role.** Note: If
12441253
any metadata requested in steps 4.4.1 - 4.4.2.3 cannot be downloaded nor
12451254
validated, end the search and report that the target cannot be found.
12461255

1247-
* **4.4.1**. If this role has been visited before, then skip this role (so
1256+
* **4.5.1**. If this role has been visited before, then skip this role (so
12481257
that cycles in the delegation graph are avoided). Otherwise, if an
12491258
application-specific maximum number of roles have been visited, then go to
12501259
step 5 (so that attackers cannot cause the client to waste excessive
12511260
bandwidth or time). Otherwise, if this role contains metadata about the
12521261
desired target, then go to step 5.
12531262

1254-
* **4.4.2**. Otherwise, recursively search the list of delegations in order
1263+
* **4.5.2**. Otherwise, recursively search the list of delegations in order
12551264
of appearance.
12561265

1257-
* **4.4.2.1**. If the current delegation is a multi-role delegation,
1266+
* **4.5.2.1**. If the current delegation is a multi-role delegation,
12581267
recursively visit each role, and check that each has signed exactly the
12591268
same non-custom metadata (i.e., length and hashes) about the target (or
12601269
the lack of any such metadata).
12611270

1262-
* **4.4.2.2**. If the current delegation is a terminating delegation,
1271+
* **4.5.2.2**. If the current delegation is a terminating delegation,
12631272
then jump to step 5.
12641273

1265-
* **4.4.2.3**. Otherwise, if the current delegation is a non-terminating
1274+
* **4.5.2.3**. Otherwise, if the current delegation is a non-terminating
12661275
delegation, continue processing the next delegation, if any. Stop the
12671276
search, and jump to step 5 as soon as a delegation returns a result.
12681277

0 commit comments

Comments
 (0)