@@ -996,6 +996,11 @@ repo](https://github.com/theupdateframework/specification/issues).
996
996
997
997
### ** The client application**
998
998
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
+
999
1004
** 0** . ** Load the trusted root metadata file.** We assume that a good, trusted
1000
1005
copy of this file was shipped with the package manager or software updater
1001
1006
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).
1020
1025
* ** 1.3. Check signatures.** Version N+1 of the root metadata file MUST have
1021
1026
been signed by: (1) a threshold of keys specified in the trusted root
1022
1027
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.
1024
1032
1025
1033
* ** 1.4. Check for a rollback attack.** The version number of the trusted
1026
1034
root metadata file (version N) must be less than or equal to the version
1027
1035
number of the new root metadata file (version N+1). Effectively, this means
1028
1036
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.
1030
1041
1031
1042
* ** 1.5** . Note that the expiration of the new (intermediate) root metadata
1032
1043
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).
1037
1048
* ** 1.7** . ** Repeat steps 1.1 to 1.7** .
1038
1049
1039
1050
* ** 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.
1041
1055
1042
1056
* ** 1.9** . ** If the timestamp and / or snapshot keys have been rotated, then
1043
1057
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
1057
1071
1058
1072
* ** 2.1** . ** Check signatures.** The new timestamp metadata file must have
1059
1073
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.
1061
1076
1062
1077
* ** 2.2** . ** Check for a rollback attack.** The version number of the trusted
1063
1078
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.
1065
1082
1066
1083
* ** 2.3** . ** Check for a freeze attack.** The latest known time should be
1067
1084
lower than the expiration timestamp in the new timestamp metadata file. If
1068
1085
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.
1070
1088
1071
1089
** 3** . ** Download snapshot metadata file** , up to the number of bytes specified
1072
1090
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
1077
1095
the timestamp metadata file. In either case, the client MUST write the file to
1078
1096
non-volatile storage as FILENAME.EXT.
1079
1097
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
1081
1100
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.
1083
1103
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.
1086
1108
1087
1109
* ** 3.3** . ** Check for a rollback attack.**
1088
1110
@@ -1092,19 +1114,24 @@ non-volatile storage as FILENAME.EXT.
1092
1114
1093
1115
* ** 3.3.2** . The version number of the trusted snapshot metadata file, if
1094
1116
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.
1096
1120
1097
1121
* ** 3.3.3** . The version number of the targets metadata file, and all
1098
1122
delegated targets metadata files (if any), in the trusted snapshot metadata
1099
1123
file, if any, MUST be less than or equal to its version number in the new
1100
1124
snapshot metadata file. Furthermore, any targets metadata filename that was
1101
1125
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.
1103
1129
1104
1130
* ** 3.4** . ** Check for a freeze attack.** The latest known time should be
1105
1131
lower than the expiration timestamp in the new snapshot metadata file. If
1106
1132
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.
1108
1135
1109
1136
** 4** . ** Download the top-level targets metadata file** , up to either the
1110
1137
number of bytes specified in the snapshot metadata file, or some Z number of
@@ -1120,23 +1147,29 @@ non-volatile storage as FILENAME.EXT.
1120
1147
* ** 4.1** . ** Check against snapshot metadata.** The hashes (if any), and
1121
1148
version number of the new targets metadata file MUST match the trusted
1122
1149
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.
1124
1152
1125
1153
* ** 4.2** . ** Check for an arbitrary software attack.** The new targets
1126
1154
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.
1128
1157
1129
1158
* ** 4.3** . ** Check for a rollback attack.** The version number of the trusted
1130
1159
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.
1132
1163
1133
1164
* ** 4.4** . ** Check for a freeze attack.** The latest known time should be
1134
1165
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.
1136
1169
1137
1170
* ** 4.5** . ** Perform a preorder depth-first search for metadata about the
1138
1171
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
1140
1173
validated, end the search and report that the target cannot be found.
1141
1174
1142
1175
* ** 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.
1163
1196
1164
1197
** 5** . ** Verify the desired target against its targets metadata** .
1165
1198
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.
1168
1201
1169
1202
* ** 5.2** . Otherwise, download the target (up to the number of bytes
1170
1203
specified in the targets metadata), and verify that its hashes match the
0 commit comments