Closed
Conversation
…o make it re-usable for others.
…o make it re-usable for others.
Collaborator
Author
|
Fixtures are generated using this repo: |
trishankatdatadog
suggested changes
Jul 30, 2021
trishankatdatadog
left a comment
There was a problem hiding this comment.
Will send more comments later, but this is really getting into shape, thanks!
| local: local, | ||
| remote: remote, | ||
| MaxDelegations: defaultMaxDelegations, | ||
| UpdaterMaxRoots: defaultMaxRoots, |
There was a problem hiding this comment.
How about a more descriptive name like MaxRootRotations?
| // 5.3.4 Check for an arbitrary software attack. | ||
| nPlusOnethRootMetadataSigned := &data.Root{} | ||
| // 5.3.4.1 Check that N signed N+1 | ||
| if err := c.db.Unmarshal(nPlusOneRootMetadata, nPlusOnethRootMetadataSigned, "root", c.rootVer); err != nil { |
There was a problem hiding this comment.
Not clear whether calling this function from c.db has any side effects... just needs documentation
| // Prepare for 5.3.11: If the timestamp and / or snapshot keys have been rotated, | ||
| // then delete the trusted timestamp and snapshot metadata files. | ||
| getKeyIDs := func(role string) []string { | ||
| keyIDs := make([]string, 0, len(c.db.GetRole("timestamp").KeyIDs)) |
There was a problem hiding this comment.
Suggested change
| keyIDs := make([]string, 0, len(c.db.GetRole("timestamp").KeyIDs)) | |
| keyIDs := make([]string, 0, len(c.db.GetRole(role).KeyIDs)) |
|
|
||
| // Prepare for 5.3.11: If the timestamp and / or snapshot keys have been rotated, | ||
| // then delete the trusted timestamp and snapshot metadata files. | ||
| getKeyIDs := func(role string) []string { |
There was a problem hiding this comment.
Suggested change
| getKeyIDs := func(role string) []string { | |
| getKeyIDs := func(rolename string) []string { |
lebauce
reviewed
Aug 24, 2021
| } | ||
|
|
||
| func (e ErrWrongVersion) Error() string { | ||
| return fmt.Sprintf("version %d does not match the extepcted version %d", e.Given, e.Expected) |
lebauce
reviewed
Aug 24, 2021
| if err := json.Unmarshal(b, s); err != nil { | ||
| return err | ||
| } | ||
| // Note: If verification fails, then we wont attemp to unmarshal |
lebauce
reviewed
Aug 24, 2021
| if err := json.Unmarshal(s.Signed, v); err != nil { | ||
| return err | ||
| } | ||
| if verifyErr != nil { |
Collaborator
Author
|
This is an abandoned PR. We decided to update the go-tuf upstream now. Please review this instead: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Update the root according to
https://theupdateframework.github.io/specification/v1.0.19/index.html#load-trusted-root