@@ -1455,10 +1455,9 @@ it in the next step.
1455
1455
6 . ** Persist targets metadata** . The client MUST write the file to
1456
1456
non-volatile storage as FILENAME.EXT (e.g. targets.json).
1457
1457
1458
- 7 . ** Perform a pre-order depth-first search for metadata about the
1459
- desired target, beginning with the top-level targets role.** Note: If
1460
- any metadata requested in steps 5.6.7.1 - 5.6.7.2 cannot be downloaded nor
1461
- validated, end the search and report that the target cannot be found.
1458
+ 7 . ** Perform a preorder depth-first search for metadata about the
1459
+ desired target.** Let TARGETS be the current metadata, beginning with the
1460
+ top-level targets metadata role.
1462
1461
1463
1462
1 . If this role has been visited before, then skip this role
1464
1463
(so that cycles in the delegation graph are avoided). Otherwise, if an
@@ -1470,18 +1469,55 @@ it in the next step.
1470
1469
2 . Otherwise, recursively search the list of delegations in
1471
1470
order of appearance.
1472
1471
1473
- 1 . If the current delegation is a multi-role delegation,
1472
+ 1 . Let DELEGATE denote the current target role TARGETS is
1473
+ delegating to.
1474
+
1475
+ 2 . ** Download the DELEGATE tarets metadata file** , up to either
1476
+ the number of bytes specified in the snapshot metadata file, or some Z
1477
+ number of bytes. The value for Z is set by the authors of the application
1478
+ using TUF. For example, Z may be tens of kilobytes. IF DELEGATE cannot be
1479
+ found, end the search and report the target cannot be found. If
1480
+ consistent snapshots are not used (see Section 7), then the filename used
1481
+ to download the targets metadata file is of the fixed form FILENAME.EXT
1482
+ (e.g., delegated_rol.json). Otherwise, the filename is of the form
1483
+ VERSION_NUMBER.FILENAME.EXT (e.g., 42.delegated_role.json), where
1484
+ VERSION_NUMBER is the version number of the DELEGATE metadata file listed
1485
+ in the snapshot metadata file. In either case, the client MUST write the
1486
+ file to non-volatile storage as FILENAME.EXT.
1487
+
1488
+ 3 . ** Check against snapshot metadata.** The hashes (if any), and
1489
+ version number of the new DELEGATE metadata file MUST match the trusted
1490
+ snapshot metadata. This is done, in part, to prevent a mix-and-match
1491
+ attack by man-in-the-middle attackers. If the new DELEGATE metadata file
1492
+ does not match, discard it, end the search, and report the target cannot
1493
+ be found.
1494
+
1495
+ 4 . ** Check for an arbitrary software attack.** The new DELEGATE
1496
+ metadata file MUST have been signed by a threshold of keys specified in the
1497
+ TARGETS metadata file. If the new DELEGATE metadata file is not signed
1498
+ as required, discard it, end the search, and report the target cannot be
1499
+ found.
1500
+
1501
+ 5 . ** Check for a rollback attack.** The version number of the
1502
+ trusted DELEGATE metadata file, if any, MUST be less than or equal to the
1503
+ version number of the new DELEGATE metadata file. If the new DELEGATE
1504
+ metadata file is older than the trusted DELEGATE metadata file, discard
1505
+ it, end the search, and report the target cannot be found.
1506
+
1507
+ 6 . If the current delegation is a multi-role delegation,
1474
1508
recursively visit each role, and check that each has signed exactly the
1475
1509
same non-custom metadata (i.e., length and hashes) about the target (or
1476
- the lack of any such metadata).
1510
+ the lack of any such metadata). Otherwise, discard it, end the search,
1511
+ and report the target cannot be found.
1477
1512
1478
- 2 . If the current delegation is a terminating delegation,
1479
- then jump to step [[ #fetch-target]] .
1513
+ 7 . If the current delegation is a terminating delegation,
1514
+ then jump to step [[ #fetch-target]] ..
1480
1515
1481
- 3 . Otherwise, if the current delegation is a
1482
- non-terminating delegation, continue processing the next delegation, if
1483
- any. Stop the search, and jump to step [[ #fetch-target]] as soon as a delegation
1484
- returns a result.
1516
+ 8 . Otherwise, if the current delegation is a non-terminating
1517
+ delegation, continue processing the next delegation, if any, by repeating
1518
+ the preorder depth-first search with DELEGATE as the current TARGET role.
1519
+ Stop the search, and jump to step [[ #fetch-target]] . as soon as a
1520
+ delegation returns a result.
1485
1521
1486
1522
## Fetch target ## {#fetch-target}
1487
1523
0 commit comments