Skip to content

Commit 8877a90

Browse files
Merge pull request #24 from vladimir-v-diaz/revise_steps_requiring_failure_issue#21
Report failure for update steps that require it. Fix issue #21
2 parents 6564a24 + c56a59b commit 8877a90

File tree

1 file changed

+53
-20
lines changed

1 file changed

+53
-20
lines changed

tuf-spec.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,11 @@ repo](https://github.com/theupdateframework/specification/issues).
996996

997997
### **The client application**
998998

999+
Note: If a step in the following workflow does not succeed (e.g., the update
1000+
is aborted because a new metadata file was not signed), the client should
1001+
still be able to update again in the future. Errors raised during the update
1002+
process should not leave clients in an unrecoverable state.
1003+
9991004
**0**. **Load the trusted root metadata file.** We assume that a good, trusted
10001005
copy of this file was shipped with the package manager or software updater
10011006
using an out-of-band process. Note that the expiration of the trusted root
@@ -1020,13 +1025,19 @@ repo](https://github.com/theupdateframework/specification/issues).
10201025
* **1.3. Check signatures.** Version N+1 of the root metadata file MUST have
10211026
been signed by: (1) a threshold of keys specified in the trusted root
10221027
metadata file (version N), and (2) a threshold of keys specified in the new
1023-
root metadata file being validated (version N+1).
1028+
root metadata file being validated (version N+1). If version N+1 is not
1029+
signed as required, discard it, abort the update cycle, and report the
1030+
signature failure. On the next update cycle, begin at step 0 and version N
1031+
of the root metadata file.
10241032

10251033
* **1.4. Check for a rollback attack.** The version number of the trusted
10261034
root metadata file (version N) must be less than or equal to the version
10271035
number of the new root metadata file (version N+1). Effectively, this means
10281036
checking that the version number signed in the new root metadata file is
1029-
indeed N+1.
1037+
indeed N+1. If the version of the new root metadata file is less than the
1038+
trusted metadata file, discard it, abort the update cycle, and report the
1039+
rollback attack. On the next update cycle, begin at step 0 and version N of
1040+
the root metadata file.
10301041

10311042
* **1.5**. Note that the expiration of the new (intermediate) root metadata
10321043
file does not matter yet, because we will check for it in step 1.8.
@@ -1037,7 +1048,10 @@ repo](https://github.com/theupdateframework/specification/issues).
10371048
* **1.7**. **Repeat steps 1.1 to 1.7**.
10381049

10391050
* **1.8**. **Check for a freeze attack.** The latest known time should be
1040-
lower than the expiration timestamp in the trusted root metadata file.
1051+
lower than the expiration timestamp in the trusted root metadata file
1052+
(version N). If the trusted root metadata file has expired, abort the update
1053+
cycle, report the potential freeze attack. On the next update cycle, begin
1054+
at step 0 and version N of the root metadata file.
10411055

10421056
* **1.9**. **If the timestamp and / or snapshot keys have been rotated, then
10431057
delete the trusted timestamp and snapshot metadata files.** This is done in
@@ -1057,16 +1071,20 @@ used to download the timestamp metadata file is of the fixed form FILENAME.EXT
10571071

10581072
* **2.1**. **Check signatures.** The new timestamp metadata file must have
10591073
been signed by a threshold of keys specified in the trusted root metadata
1060-
file.
1074+
file. If the new timestamp metadata file is not properly signed, discard it,
1075+
abort the update cycle, and report the signature failure.
10611076

10621077
* **2.2**. **Check for a rollback attack.** The version number of the trusted
10631078
timestamp metadata file, if any, must be less than or equal to the version
1064-
number of the new timestamp metadata file.
1079+
number of the new timestamp metadata file. If the new timestamp metadata
1080+
file is older than the trusted timestamp metadata file, discard it, abort the
1081+
update cycle, and report the potential rollback attack.
10651082

10661083
* **2.3**. **Check for a freeze attack.** The latest known time should be
10671084
lower than the expiration timestamp in the new timestamp metadata file. If
10681085
so, the new timestamp metadata file becomes the trusted timestamp metadata
1069-
file.
1086+
file. If the new timestamp metadata file has expired, discard it, abort the
1087+
update cycle, and report the potential freeze attack.
10701088

10711089
**3**. **Download snapshot metadata file**, up to the number of bytes specified
10721090
in the timestamp metadata file. If consistent snapshots are not used (see
@@ -1077,12 +1095,16 @@ VERSION_NUMBER is the version number of the snapshot metadata file listed in
10771095
the timestamp metadata file. In either case, the client MUST write the file to
10781096
non-volatile storage as FILENAME.EXT.
10791097

1080-
* **3.1**. **Check against timestamp metadata.** The hashes and version number
1098+
* **3.1**. **Check against timestamp metadata.** The hashes and version
1099+
* number
10811100
of the new snapshot metadata file MUST match the hashes and version number
1082-
listed in timestamp metadata.
1101+
listed in timestamp metadata. If hashes and version do not match, discard
1102+
the new snapshot metadata, abort the update cycle, and report the failure.
10831103

1084-
* **3.2**. **Check signatures.** The snapshot metadata file MUST have been
1085-
signed by a threshold of keys specified in the trusted root metadata file.
1104+
* **3.2**. **Check signatures.** The new snapshot metadata file MUST have
1105+
been signed by a threshold of keys specified in the trusted root metadata
1106+
file. If the new snapshot metadata file is not signed as required, discard
1107+
it, abort the update cycle, and report the signature failure.
10861108

10871109
* **3.3**. **Check for a rollback attack.**
10881110

@@ -1092,19 +1114,24 @@ non-volatile storage as FILENAME.EXT.
10921114

10931115
* **3.3.2**. The version number of the trusted snapshot metadata file, if
10941116
any, MUST be less than or equal to the version number of the new snapshot
1095-
metadata file.
1117+
metadata file. If the new snapshot metadata file is older than the trusted
1118+
metadata file, discard it, abort the update cycle, and report the potential
1119+
rollback attack.
10961120

10971121
* **3.3.3**. The version number of the targets metadata file, and all
10981122
delegated targets metadata files (if any), in the trusted snapshot metadata
10991123
file, if any, MUST be less than or equal to its version number in the new
11001124
snapshot metadata file. Furthermore, any targets metadata filename that was
11011125
listed in the trusted snapshot metadata file, if any, MUST continue to be
1102-
listed in the new snapshot metadata file.
1126+
listed in the new snapshot metadata file. If any of these conditions are
1127+
not met, discard the new snaphot metadadata file, abort the update cycle,
1128+
and report the failure.
11031129

11041130
* **3.4**. **Check for a freeze attack.** The latest known time should be
11051131
lower than the expiration timestamp in the new snapshot metadata file. If
11061132
so, the new snapshot metadata file becomes the trusted snapshot metadata
1107-
file.
1133+
file. If the new snaphshot metadata file is expired, discard it, abort the
1134+
update cycle, and report the potential freeze attack.
11081135

11091136
**4**. **Download the top-level targets metadata file**, up to either the
11101137
number of bytes specified in the snapshot metadata file, or some Z number of
@@ -1120,23 +1147,29 @@ non-volatile storage as FILENAME.EXT.
11201147
* **4.1**. **Check against snapshot metadata.** The hashes (if any), and
11211148
version number of the new targets metadata file MUST match the trusted
11221149
snapshot metadata. This is done, in part, to prevent a mix-and-match attack
1123-
by man-in-the-middle attackers.
1150+
by man-in-the-middle attackers. If the new targets metadata file does not
1151+
match, discard it, abort the update cycle, and report the failure.
11241152

11251153
* **4.2**. **Check for an arbitrary software attack.** The new targets
11261154
metadata file MUST have been signed by a threshold of keys specified in the
1127-
trusted root metadata file.
1155+
trusted root metadata file. If the new targets metadat file is not signed
1156+
as required, discard it, abort the update cycle, and report the failure.
11281157

11291158
* **4.3**. **Check for a rollback attack.** The version number of the trusted
11301159
targets metadata file, if any, MUST be less than or equal to the version
1131-
number of the new targets metadata file.
1160+
number of the new targets metadata file. If the new targets metadata file is
1161+
older than the trusted targets metadata file, discard it, abort the update
1162+
cycle, and report the potential rollback attack.
11321163

11331164
* **4.4**. **Check for a freeze attack.** The latest known time should be
11341165
lower than the expiration timestamp in the new targets metadata file. If so,
1135-
the new targets metadata file becomes the trusted targets metadata file.
1166+
the new targets metadata file becomes the trusted targets metadata file. If
1167+
the new targets metadata file is expired, discard it, abort the update cycle,
1168+
and report the potential freeze attack.
11361169

11371170
* **4.5**. **Perform a preorder depth-first search for metadata about the
11381171
desired target, beginning with the top-level targets role.** Note: If
1139-
metadata requested in steps 4.5.1 - 4.5.2.3 cannot be downloaded nor
1172+
any metadata requested in steps 4.5.1 - 4.5.2.3 cannot be downloaded nor
11401173
validated, end the search and report that the target cannot be found.
11411174

11421175
* **4.5.1**. If this role has been visited before, then skip this role (so
@@ -1163,8 +1196,8 @@ non-volatile storage as FILENAME.EXT.
11631196

11641197
**5**. **Verify the desired target against its targets metadata**.
11651198

1166-
* **5.1**. If there is no targets metadata about this target, then report that
1167-
there is no such target.
1199+
* **5.1**. If there is no targets metadata about this target, abort the
1200+
update cycle and report that there is no such target.
11681201

11691202
* **5.2**. Otherwise, download the target (up to the number of bytes
11701203
specified in the targets metadata), and verify that its hashes match the

0 commit comments

Comments
 (0)