-
Notifications
You must be signed in to change notification settings - Fork 56
Clarify timestamp.json METAFILES format #90
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
Merged
lukpueh
merged 10 commits into
theupdateframework:master
from
joshuagl:joshuagl/timestamp-length
Mar 6, 2020
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc00f7f
LENGTH isn't optional in timestamp.json for snapshot.json
joshuagl 0c73d44
Clarify timestamp.json METAFILES format
joshuagl 3ca7683
Revert "97312dd" and "d97da38"
lukpueh e53f11c
Clarify snapshot download limit on client
lukpueh a5848e7
Clarify snapshot and timestamp METAFILES
lukpueh e360733
Fix typo in "4.6. File formats: timestamp.json"
lukpueh 4f6ce2e
Ensure steps in the detailed workflow are consistent in use of variables
joshuagl d8dcf66
Bump patch version to 1.0.1
joshuagl 081e56a
Clarify snapshot+targets metadata hash check
lukpueh 53f6ea3
Update Last modified: **6 March 2020**
lukpueh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to note when length and hashes should be included (ie backwards compatibility for both, using length as an exact download size)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backwards compatibility is one reason, yes, but I believe the more important reason is to protect against certain security attacks. Please see Section 5.6 of Mercury.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if we are bringing back hashes and length here, we should add the corresponding checks in the download process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnm678, @trishankatdatadog: Good idea. Could you push a commit with such a note?
@trishankatdatadog: What's missing from the existing (L1136-1138) and newly proposed (L11160-1163) download checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukpueh Those are good checks, but:
snapshot
metadata.targets
role or its delegations, do we mention checking optional hashes and length from thesnapshot
metadata?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing these out, @trishankatdatadog!
Is another length match check in 3.1. necessary? We already say in 3. that the client should download snapshot.json up to the length specified in timestamp.json (if specified).
Regarding optionality of hashes, I agree we could add a "(if any)" note in 3.1, as we do for targets in 4.1.
For top-level targets we do say in 4.1. "The hashes (if any), and version number of the new targets metadata file MUST match the trusted snapshot metadata."
I think the "(if any)" is slightly misplaced, because the hashes it refers are computed by the client. It would be more accurate to say: "The hashes and version number of the new targets metadata file MUST match the hashes (if any) and version number listed in the trusted snapshot". Let me push a commit that clarifies this.
Regarding length, similar to timestamp-snapshot in 3., we say in 4.1. that the client should download targets.json up to the length specified in snapshot.json (if specified). Do you think we need another length match check in 4.1.?
Regarding delegated targets metadata, we currently don't provide details about verification. #86 adds those details and adopts the "(if any)" wording used in 4.1. If we accept my suggestion for 4.1. above, we should adopt this for delegated targets metadata in #86.
Similarly, if we add a length match check for top-level targets metadata, we should adopt this for delegated in #86 too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified optionality of hashes (checks) in 0bdb99c. Let me know if we should add another optional length check...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a second length check isn't necessary as the length is already used when downloading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.