Commit Graph

8 Commits

Author SHA1 Message Date
Ying Li 117124e6da Address review comments:
- fix a spelling mistake and rename the builder retroactive-checksum-check functions
- on client update bootstrapping, we should not validate the root on disk against any trust pinning configuration

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 14:45:37 -07:00
Ying Li ab7064ea12 Change minimum required version of metadata to be 1, not 0
Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li 5d1b4bc6ec Add ConsistentInfo and snapshot/timestamp retroactive checksum tests for the builder.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li c9e91446a1 Builder interface cleanup and bugfixes:
- can never set an invalid repo, so we can remove the failed builder state
- once a builder is "finished", it's swapped out with one that has no state and cannot be modified
- add builder tests for the negative path cases where builder should error
- fix bug with GenerateSnapshot where we didn't check for a targets to be loaded when generating for the first time

This also adds some negative path tests (cases in which the builder errors due to invalid input or things not being loaded)

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li aba6317da0 Remove `SetRoot`, `SetTargets`, `SetTimestamp`, and `SetSnapshot` on tuf.Repo.
Builder is the only one that sets them now.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li 5acab543e4 Update the client to have an old builder and a new builder, and to only use
cached version numbers to check downloaded version numbers of cached data
validates against the old builder.

This also removes the `GetRepo` function of the builder and adds some data
accessors instead that are necessary to do a consistent download and check
versions, that way the downloader doesn't need to fish around in the repo
itself for data in order to figure out what to download.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li 04ec865b31 Update all the server validation and generation code to use the builder.
This means that the server cannot accept any roots not signed by an
x509 key whose GUN doesn't match the GUN being updated.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:58 -07:00
Ying Li a34e2e1dd1 Introduce a builder which builds a TUF repo object, which can be used by
the downloading client and the server validation.  This will hopefully unify
server and client validation.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-04-27 10:58:57 -07:00