Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Tap 16 #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* [TAP 11: Using POUFs for Interoperability](tap11.md)
* [TAP 12: Improving keyid flexibility](tap12.md)
* [TAP 15: Succinct hashed bin delegations](tap15.md)
* [TAP 16: Snapshot Merkle Trees](tap16.md)
* [TAP 20: Self-revocation](tap20.md)

## Draft

* [TAP 13: User Selection of the Top-Level Target Files Through Mapping Metadata](tap13.md)
* [TAP 16: Snapshot Merkle Trees](tap16.md)
* [TAP 17: Remove Signature Wrapper from the TUF Specification](tap17.md)
* [TAP 18: Ephemeral identity verification using sigstore's Fulcio for TUF developer key management](tap18.md)
* [TAP 19: Content Addressable Systems and TUF](tap19.md)
Expand Down
32 changes: 21 additions & 11 deletions tap16.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
* TAP: 16
* Title: Snapshot Merkle Trees
* Version: 0
* Last-Modified: 22/01/2021
* Last-Modified: 02/04/2024
* Author: Marina Moore, Justin Cappos
* Type: Standardization
* Status: Draft
* Status: Accepted
* Content-Type: markdown
* Created: 14/09/2020
* +TUF-Version:
Expand Down Expand Up @@ -111,7 +111,10 @@ In addition the path should contain direction information so that the client
will know whether each listed node is a left or right sibling when reconstructing the
tree.

This information will be included in the following metadata format:
While the exact format will depend on the algorithm specified in a POUF,
each leaf must contain equivalent information to the version information
defined for snapshot metadata. We provide an example metadata format:

```
{ “leaf_contents”: {METAFILES},
“merkle_path”: {INDEX:HASH}
Expand All @@ -123,9 +126,16 @@ Where `METAFILES` is the version information as defined for snapshot metadata,
`INDEX` provides the ordering of nodes, `HASH` is the hash of the sibling node,
and `DIR` indicates whether the given node is a left or right sibling.

Alternatively, if using a Merkle prefix tree, the hash of the `METAPATH` can
be used as the location in the Merkle tree, with the version information in the
node. The Merkle path and path directions can then be provided with this version
information as the snapshot Merkle metadata file for each leaf.

## Timestamp

In addition, the following optional field will be added to timestamp metadata.
If this field is included, the client should use snapshot Merkle metadata to
verify updates instead:
verify updates:

```
("merkle_root": ROOT_HASH)
Expand All @@ -136,7 +146,7 @@ Where `ROOT_HASH` is the hash of the Merkle tree's root node.
Note that snapshot Merkle metadata files do not need to be signed by a snapshot
key because the path information will be verified based on the Merkle root
provided in timestamp. Removing these signatures will provide additional space
savings for clients.
savings for clients. The timestamp metadata must still be signed.

Previous versions of snapshot Merkle metadata files using the current timestamp
key must remain available to clients and auditors. The repository may store
Expand All @@ -149,10 +159,10 @@ If a client sees the `merkle_root` field in timestamp metadata, they will use
the snapshot Merkle metadata to check version information. If this field is
present, the client will download the snapshot Merkle metadata file only for
the targets metadata the client is attempting to update. The client will verify the
snapshot Merkle metadata file by reconstructing the Merkle tree and comparing
the computed root hash to the hash provided in timestamp metadata. If the
hashes do not match, the snapshot Merkle metadata is invalid. Otherwise, the
client will use the version information in the verified snapshot Merkle
snapshot Merkle metadata file by reconstructing the path through the Merkle tree
and comparing the computed root hash to the hash provided in timestamp metadata.
If the hashes do not match, the snapshot Merkle metadata is invalid. Otherwise,
the client will use the version information in the verified snapshot Merkle
metadata to proceed with the update.

For additional rollback protection, the client may download previous versions
Expand Down Expand Up @@ -306,8 +316,8 @@ compatibility for clients and repositories.

# Augmented Reference Implementation

https://github.com/theupdateframework/python-tuf/pull/1113/
TODO: auditor implementation
* https://github.com/theupdateframework/python-tuf/pull/1113/
* https://github.com/znewman01/scalingsnapshots/blob/main/sssim/src/authenticator/merkle.rs

# Copyright

Expand Down