diff --git a/README.md b/README.md index 51bf8282..4def9d3e 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,25 @@ Stages the removal of files with the given path(s) from the `targets` manifest (they get removed from the filesystem when the change is committed). Specifying no paths removes all files from the `targets` manifest. +#### `dele-gen-key [--expires=] ` + +Creates a new delegation role's key. Prompts the user for an encryption passphrase +(unless the `--insecure-plaintext` flag is set), then generates a new signing key and +writes it to the relevant key file in the `keys` directory. It also stages +the addition of the new key to the `target` manifest. + +#### `dele-add [...]` + +Hashes files in the `staged/targets` directory at the given path(s), then +updates and stages the delegated target manifest. Specifying no paths hashes all +files in the `staged/targets` directory. + +#### `dele-remove [...]` + +Stages the removal of files with the given path(s) from the certain non-top target manifest +(they get removed from the filesystem when the change is committed). Specifying +no paths removes all files from the certain non-top target manifest. + #### `tuf snapshot [--compression=]` Expects a staged, fully signed `targets` manifest and stages an appropriate @@ -100,6 +119,11 @@ Removes all staged manifests and targets. Outputs a JSON serialized array of root keys to STDOUT. The resulting JSON should be distributed to clients for performing initial updates. +#### `tuf target-keys` + +Outputs a JSON serialized array of target keys to STDOUT. The resulting JSON +should be distributed to clients for performing initial updates. + For a list of supported commands, run `tuf help` from the command line. ### Examples @@ -152,6 +176,12 @@ Enter targets keys passphrase: Repeat targets keys passphrase: Generated targets key with ID 8cf4810c +$ tuf dele-gen-key r01 +Enter r01 keys passphrase: +Repeat r01 keys passphrase: +Enter targets keys passphrase: +Generated r01 key with ID 4d6ddd68 + $ tuf gen-key snapshot Enter snapshot keys passphrase: Repeat snapshot keys passphrase: @@ -165,12 +195,14 @@ Generated timestamp key with ID a3768063 $ tree . . ├── keys +│ ├── r01.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository └── staged ├── root.json + ├── targets.json └── targets ``` @@ -193,15 +225,17 @@ Enter root keys passphrase: The staged `root.json` can now be copied back to the repo box ready to be committed alongside other manifests. -#### Add a target file +#### Add target files Assuming a staged, signed `root` manifest and the file to add exists at -`staged/targets/foo/bar/baz.txt`: +`staged/targets/foo/bar/baz.txt` and `staged/targets/sin.txt`: ``` $ tree . . ├── keys +│ ├── r01.json +│   ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json @@ -209,6 +243,7 @@ $ tree . └── staged    ├── root.json └── targets + ├── sin.txt └── foo └── bar └── baz.txt @@ -216,16 +251,23 @@ $ tree . $ tuf add foo/bar/baz.txt Enter targets keys passphrase: +$tuf dele-add r01 sin.txt +Enter r01 keys passphrase: + $ tree . . ├── keys +│ ├── r01.json +│   ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository └── staged + ├── r01.json    ├── root.json ├── targets + │ ├── sin.txt │   └── foo │   └── bar │   └── baz.txt @@ -240,14 +282,17 @@ Enter timestamp keys passphrase: $ tree . . ├── keys +│ ├── r01.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository └── staged + ├── r01.json    ├── root.json    ├── snapshot.json ├── targets + │ ├── sin.txt │   └── foo │   └── bar │   └── baz.txt @@ -259,13 +304,17 @@ $ tuf commit $ tree . . ├── keys +│ ├── r01.json +│ ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets +│ │ ├── sin.txt │   │   └── foo │   │   └── bar │   │   └── baz.txt @@ -274,21 +323,26 @@ $ tree . └── staged ``` -#### Remove a target file +#### Remove target files -Assuming the file to remove is at `repository/targets/foo/bar/baz.txt`: +Assuming the file to remove is at `repository/targets/foo/bar/baz.txt` +and `repository/targets/sin.txt`: ``` $ tree . . ├── keys +│ ├── r01.json +│ ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets +│ │ ├── sin.txt │   │   └── foo │   │   └── bar │   │   └── baz.txt @@ -299,22 +353,31 @@ $ tree . $ tuf remove foo/bar/baz.txt Enter targets keys passphrase: +$tuf dele-remove r01 sin.txt +Enter r01 keys passphrase: + $ tree . . ├── keys +│ ├── r01.json +│ ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets +│ │ ├── sin.txt │   │   └── foo │   │   └── bar │   │   └── baz.txt │   ├── targets.json │   └── timestamp.json └── staged + ├── r01.json + ├── targets └── targets.json $ tuf snapshot @@ -326,10 +389,13 @@ Enter timestamp keys passphrase: $ tree . . ├── keys +│ ├── r01.json +│ ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets @@ -339,6 +405,8 @@ $ tree . │   ├── targets.json │   └── timestamp.json └── staged + ├── r01.json + ├── targets    ├── snapshot.json    ├── targets.json    └── timestamp.json @@ -348,10 +416,13 @@ $ tuf commit $ tree . . ├── keys +│ ├── r01.json +│ ├── root.json │   ├── snapshot.json │   ├── targets.json │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets.json @@ -359,7 +430,8 @@ $ tree . └── staged ``` -#### Regenerate manifests based on targets tree +#### Regenerate manifests based on targets tree +(Haven't finished yet) ``` $ tree . @@ -454,6 +526,7 @@ $ tree . ├── keys │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets @@ -472,6 +545,7 @@ $ tree . ├── keys │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets @@ -490,6 +564,7 @@ $ tree . ├── keys │   └── timestamp.json ├── repository +│ ├── r01.json │   ├── root.json │   ├── snapshot.json │   ├── targets diff --git a/client/interop_test.go b/client/interop_test.go index 712ca5fe..48cea79a 100644 --- a/client/interop_test.go +++ b/client/interop_test.go @@ -172,14 +172,13 @@ func (t *testCase) runStep(c *C, stepName string, init bool) { c.Assert(err, IsNil) c.Assert(util.TargetFileMetaEqual(file, meta), IsNil) + c.Log(t.targets) // download the files and check they have the correct content - for name, data := range t.targets { - for _, prefix := range []string{"", "/"} { - var dest testDestination - c.Assert(client.Download(prefix+name, &dest), IsNil) - c.Assert(dest.deleted, Equals, false) - c.Assert(dest.String(), Equals, string(data)) - } + for _, prefix := range []string{"", "/"} { + var dest testDestination + c.Assert(client.Download(prefix+targetName, &dest), IsNil) + c.Assert(dest.deleted, Equals, false) + c.Assert(dest.String(), Equals, string(data)) } } diff --git a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/snapshot.json index 88e7271d..50a00f7c 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "ead7e8f3a5717ef8316d36f13f870fa70c484a451ced93342b6cd8d52d91b9f49d88278c34b8fab14f6d127f9701e3f272d479794795f5bffc364bf3a441cb08" + "sig": "f938670ebfa77e0d5ed9e14b8f975ae8f1092c19f8a47bbec99fcb6259ba4fbcb69dcf8db86534f620b66681a4afa6d54a6f1d62b90301194c27c0664bc64a00" } ], "signed": { @@ -18,9 +18,9 @@ }, "targets.json": { "hashes": { - "sha512": "e0dd9a3833d117cd7bb6fdaae8923d5bda0661cb242be067813bfec3114d83943230b8bb7fcbf093a15d5840f1ecd969f44d3df13e2045d3fb7d22903fbc1bf5" + "sha512": "0f7aa68c338c27c00f83713965452237cfc83faf679546d3e21559492d9d382d36a3bfb8465342570de8abc703aad607c07c28d3d6e24745914e5aa445642b61" }, - "length": 588, + "length": 617, "version": 1 } }, diff --git a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/targets.json index 5bb513ff..96886aac 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/targets.json @@ -2,12 +2,14 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "4d5c3a5da43f3792d077c1128fa28585982ff2957fae59be02a831fc920d0b91cbeaa99fd6c15066ec4da8bf12f993440a90d1624fd7b0a68070e5d60ed2500f" + "sig": "5b27c3637faed11eb96662b2801a06045afbd4500d4f4e40c3c2a7d06dd578a33fa5fdf785f23550286d395d48c5cfbd862aec3d2da62e579192bdeda862ee09" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { "0": { diff --git a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/timestamp.json index 05fa2178..7387e8f3 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/0/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/0/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "f21f0edf928c8683ad5751ee7e79cbc3eb8c340ae418d93bcda1710c4a8ad0c858576b0d662db20128db2eabf2d4cec1b9babfc71e4171e501981a11f5c6d10f" + "sig": "75e1adbaa4ba18441ef3e350894b3df46b2b35d41de7381534969a2868dfd055157b1d91c1d9a3e744688598dc011f6e74183ec7ac623e05692fec9ef847b304" } ], "signed": { @@ -11,7 +11,7 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "f4c7e7bc04b386d303f23579ff32f9380831c0ca993974c7e2a40e6ee0eb51f392e315f09cf807a8c09d1b5a0a30bca27b81736d9522af2fd951dd8413eec4a5" + "sha512": "3a63c824a494d96a59358d20c901332422c7404e2a217f8f3c98fee0f9489da5fc8e4b59665dd1d53aa508794a26812bf7c42e38077db58640febc7d3e41aaa3" }, "length": 847, "version": 1 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json deleted file mode 120000 index 0ffd2b6d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../0/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json new file mode 100644 index 00000000..a10e5357 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.root.json @@ -0,0 +1,91 @@ +{ + "signatures": [ + { + "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", + "sig": "6658129fea318671119384ba07d53121ad14981730f1e6761c18358140fc1aa2ff8cfec9a50ce46642aa55d55369ce0ccec0aa7d3dea224ead3971747e58670a" + }, + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "4e19bc38c94625d5a1c8a396f07e1d37fadbffdd95b705ec3a7b141558dbf059c139d0355bb519314e7396d36f798d65bebe176d0144f0949f2a20eefd9f840c" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" + }, + "scheme": "ed25519" + }, + "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "62f71f99c788f16bcdc8bb252455e3a690350e4ddea5a6aab1f9a3aaabcf369a" + }, + "scheme": "ed25519" + }, + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.snapshot.json new file mode 100644 index 00000000..855a8ea9 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", + "sig": "fe745ed57ec6feb0aec1e5b8c67ea7ae26185dba9111204f2952fa523b6f6c2a9ed68dfe51175a1a3baf25d67e9e0f287512c0bd5c25009d43f57b50143f5808" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "0b7689274ac6797eda6447844d05d4b871c956394d0fa3476dd5a994a24534f2b929df60f2e2c5634ae5ab475efe30c1b41aa4c6625ca93e79616e435c81e842" + }, + "length": 2407, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "d8a4f0e52621223c32ce8c3f2d12947db366140f7e8ea9b4fecd3467979ce0fcfc7145f1bb208676783cfc0a96d02939bc27ea718e6046b2912b7a3d3d0cae54" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.targets.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.targets.json similarity index 54% rename from client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.targets.json rename to client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.targets.json index be817137..83de5b99 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/1.targets.json @@ -2,20 +2,16 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "81bcf5921834a20b8b0946815ad4316f43ffce20b3793e6653dc5fd4b98f1c6318ce2243948574e82414a102717a6f2d731250b3191c54abc8391fd867503e0b" + "sig": "92717aef431db4413db775f52e64a74b81e6c3e9883a3527a431f41668114a885c15b71c77a5cbbdbb4271ad00e404bc68b773ae017c38d3864fc4df4c382f05" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, "1": { "hashes": { "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" @@ -23,6 +19,6 @@ "length": 1 } }, - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/2.root.json deleted file mode 100644 index c26126ac..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/2.root.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "signatures": [ - { - "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", - "sig": "65f63745aa8bd39132f827c427ea6d87f620ec805d9f376b6a8400dc3db7eb964e5423d31ed08867916d039661a70d6bf255bca552248021a4e78b5d357c2b0f" - }, - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "20e91b55c995989b270091b714347b15169285cb636ef05d68d49ed7b7a96ebfda13898e0d9ef928c382873b9dba90dca492dbf705d56a4b293adaaed574340f" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" - }, - "scheme": "ed25519" - }, - "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "62f71f99c788f16bcdc8bb252455e3a690350e4ddea5a6aab1f9a3aaabcf369a" - }, - "scheme": "ed25519" - }, - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/root.json index c26126ac..a10e5357 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/root.json @@ -2,16 +2,16 @@ "signatures": [ { "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", - "sig": "65f63745aa8bd39132f827c427ea6d87f620ec805d9f376b6a8400dc3db7eb964e5423d31ed08867916d039661a70d6bf255bca552248021a4e78b5d357c2b0f" + "sig": "6658129fea318671119384ba07d53121ad14981730f1e6761c18358140fc1aa2ff8cfec9a50ce46642aa55d55369ce0ccec0aa7d3dea224ead3971747e58670a" }, { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "20e91b55c995989b270091b714347b15169285cb636ef05d68d49ed7b7a96ebfda13898e0d9ef928c382873b9dba90dca492dbf705d56a4b293adaaed574340f" + "sig": "4e19bc38c94625d5a1c8a396f07e1d37fadbffdd95b705ec3a7b141558dbf059c139d0355bb519314e7396d36f798d65bebe176d0144f0949f2a20eefd9f840c" } ], "signed": { "_type": "root", - "consistent_snapshot": false, + "consistent_snapshot": true, "expires": "2100-01-01T00:00:00Z", "keys": { "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { @@ -86,6 +86,6 @@ } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/snapshot.json index bb3d0d30..855a8ea9 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "9a90d837dd4f3f4020777108de0ea9a06ea1d5e4693247a21feecf8ab5855e356dc0ef909086b664b9535cde8c74d9130cff8faa488d97f0cd2922f61d42f309" + "sig": "fe745ed57ec6feb0aec1e5b8c67ea7ae26185dba9111204f2952fa523b6f6c2a9ed68dfe51175a1a3baf25d67e9e0f287512c0bd5c25009d43f57b50143f5808" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "db01435dcd98422dc54771acf9a0091ac2f6e223ad953dc665261b155bf84fdf4a3f306d197185f0a39fbc7f14ef2165c1aa609b2103dff49c473253f449ee02" + "sha512": "0b7689274ac6797eda6447844d05d4b871c956394d0fa3476dd5a994a24534f2b929df60f2e2c5634ae5ab475efe30c1b41aa4c6625ca93e79616e435c81e842" }, - "length": 2408, - "version": 2 + "length": 2407, + "version": 1 }, "targets.json": { "hashes": { - "sha512": "8672c435a53519972738fada6ed3b7fa37b3ea42b4fa1e436b774e697a8d696d9efbeb6c590a6e16dec0a5e7f789da82ea59a68fae63f343340d1549a075ab1b" + "sha512": "d8a4f0e52621223c32ce8c3f2d12947db366140f7e8ea9b4fecd3467979ce0fcfc7145f1bb208676783cfc0a96d02939bc27ea718e6046b2912b7a3d3d0cae54" }, - "length": 789, - "version": 2 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets.json index be817137..83de5b99 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets.json @@ -2,20 +2,16 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "81bcf5921834a20b8b0946815ad4316f43ffce20b3793e6653dc5fd4b98f1c6318ce2243948574e82414a102717a6f2d731250b3191c54abc8391fd867503e0b" + "sig": "92717aef431db4413db775f52e64a74b81e6c3e9883a3527a431f41668114a885c15b71c77a5cbbdbb4271ad00e404bc68b773ae017c38d3864fc4df4c382f05" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, "1": { "hashes": { "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" @@ -23,6 +19,6 @@ "length": 1 } }, - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/0 b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/0 deleted file mode 120000 index aced6879..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/0 +++ /dev/null @@ -1 +0,0 @@ -../../../0/repository/targets/0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/1 b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 similarity index 100% rename from client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/1 rename to client/testdata/go-tuf/consistent-snapshot-false/1/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/timestamp.json index b27f1d84..0bb94671 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/1/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/1/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "bee62f48a1383aadad3ff47ef1eeed4f28158c903c5eee2cfc55b2d4d30f6b665f943e2d2b8f5aa81a67a3ad9edb3b4a4b625cda2f7b7c2806efc7e343758b02" + "sig": "6d39b875eefff71abb4137ddd673d8599fca75e827012de9fff335621cf8a3cfef2de7289aafdea7dfba7f40ec2f6709293bdced891217f141527d930915d708" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "f8fd7a63c597491397c7b155c39286c5be15127e0570ecefbb4cf3b6a166e0c35e5ef103e48650d44aedf93ab5d26f91465c970b1c0d0aa75aaefb4d38ec38d7" + "sha512": "4f7cb7d5dacf838f0d19b6ddea263d7b0646b8f930705192536224bc2f95f03f84cb23b364edaaf9bb7ef75ebbff6e268938e7ed2c02276a206846fdf98373d1" }, "length": 847, - "version": 2 + "version": 1 } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json deleted file mode 120000 index cd730513..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json new file mode 100644 index 00000000..3a288055 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "4842fe74732b866401ef512ca8f4536cc49ca38ea7eecd5f015ad33395a7d605f3627e51ecb079ac53806fdf5b3820c2c42fce285714806e1f4dded689c3e50c" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" + }, + "scheme": "ed25519" + }, + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.snapshot.json new file mode 100644 index 00000000..775f7de0 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", + "sig": "5bcd230edaf5a974ce55aaadb6f2ce90544b57729e96cb0b8f8118e671755a1f1754639f8148729b11658340a70c312a82ca119b89b24262de123eca92ccb905" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "463e1cb7766fd1187c80265671640d34d39e07d664a60917fb78921368a672439550a9823f758ab3f9def27a5ab8040299096e688901438e32ead01f1bbb6436" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "b1f1bc5aea0672971cd2b8f5d3fdf74a7fc6ddbe2dce8408966c6d0864b970fc13a3ad8b114cea6fa2669c5a5c33483a5f46670dee89e2f94202a102f19786e5" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.targets.json new file mode 100644 index 00000000..da26a1f5 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "a49fa1e796c9c8f7722e079f08fbc2e691cfb0e2149bbc0f17bc90de9022e5c9133fd28355ab6420bca6d8dd2118294ad561d270a5b3c5d19778b11a57ef140d" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "2": { + "hashes": { + "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/2.root.json deleted file mode 120000 index bbdcb128..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/3.root.json deleted file mode 100644 index 0dec040b..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/3.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "cfe8b0919d1707ca6c23501909b77c8b94d1ede2b85a3081ab7146244cc6fe436b06ad58163919276f2e37ddbcc13a0dde4851301053dcea2a9bcabc5e1cd004" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" - }, - "scheme": "ed25519" - }, - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 3 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/root.json index 0dec040b..3a288055 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/root.json @@ -2,12 +2,12 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "cfe8b0919d1707ca6c23501909b77c8b94d1ede2b85a3081ab7146244cc6fe436b06ad58163919276f2e37ddbcc13a0dde4851301053dcea2a9bcabc5e1cd004" + "sig": "4842fe74732b866401ef512ca8f4536cc49ca38ea7eecd5f015ad33395a7d605f3627e51ecb079ac53806fdf5b3820c2c42fce285714806e1f4dded689c3e50c" } ], "signed": { "_type": "root", - "consistent_snapshot": false, + "consistent_snapshot": true, "expires": "2100-01-01T00:00:00Z", "keys": { "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/snapshot.json index dfbfc847..775f7de0 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "3840c3f286934c59194392a1f481df9c25676d9f0921d2cc5a283a540e663f8755754ff86d14175b0d7818aaf69cf1870c2779a974e32651e79de93b5b858507" + "sig": "5bcd230edaf5a974ce55aaadb6f2ce90544b57729e96cb0b8f8118e671755a1f1754639f8148729b11658340a70c312a82ca119b89b24262de123eca92ccb905" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "b72aba523da68c23ac4e1e992894aa888a8c2ce947b7a615e9382e999594053b46e83198d68606d686b8868526a346279fcb73e6800b82a1e5ca0be184ccc5cb" + "sha512": "463e1cb7766fd1187c80265671640d34d39e07d664a60917fb78921368a672439550a9823f758ab3f9def27a5ab8040299096e688901438e32ead01f1bbb6436" }, - "length": 2178, - "version": 3 + "length": 2177, + "version": 1 }, "targets.json": { "hashes": { - "sha512": "b103f5cd1d68e0b5f7b96af03a27cf971460977976cff0b1d1371dcce6d45ef78e183fa26bf886f3864e84b8ddbbfc1bab7bd0e2be180ad82ed26f22a8e9b68b" + "sha512": "b1f1bc5aea0672971cd2b8f5d3fdf74a7fc6ddbe2dce8408966c6d0864b970fc13a3ad8b114cea6fa2669c5a5c33483a5f46670dee89e2f94202a102f19786e5" }, - "length": 990, - "version": 3 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets.json index ad58a9d4..da26a1f5 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets.json @@ -2,26 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "09593c7b47f4dbf1e8ac949fa010279ffbbd36070a54a89b689378441e8111602d4236fa2962063778c82027d4746a8973ba8fea86e9c105190da9fa362d8b0c" + "sig": "a49fa1e796c9c8f7722e079f08fbc2e691cfb0e2149bbc0f17bc90de9022e5c9133fd28355ab6420bca6d8dd2118294ad561d270a5b3c5d19778b11a57ef140d" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, "2": { "hashes": { "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" @@ -29,6 +19,6 @@ "length": 1 } }, - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/0 b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/0 deleted file mode 120000 index 2ac1d8be..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/0 +++ /dev/null @@ -1 +0,0 @@ -../../../1/repository/targets/0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/1 b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/1 deleted file mode 120000 index 8e78bc37..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/1 +++ /dev/null @@ -1 +0,0 @@ -../../../1/repository/targets/1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/2 b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 similarity index 100% rename from client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/2 rename to client/testdata/go-tuf/consistent-snapshot-false/2/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/timestamp.json index 13b86324..e18b091e 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/2/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/2/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "77047b8a1d8221726b7df9d0fba92b495bcef861c1a06fe5a0ab5c579c595cda9ee546e28657e34a2b84747381ed5a557c7e273e05b97aa1e2eb429c2e1adf09" + "sig": "dfa4dffbddd403c0ab47d67061773b35c1d29766bca159724a6202eb15894de4d20cd44e1b8823582ae38676ab73ee36b713747d5a591db8a9654e0bbc63db07" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "3a27aa26ff6e341bf45f8237208583a1cbad65c88b19531b17d1f33eb4aaf7533f0ae1c263746101f285a608ec54c6330878c6ae3b331595ee6cc8b90c53a025" + "sha512": "e5c4d07419c0216698fef07f0463d32503af32bf4ad110987dfa646dfebb294302c8bd49de21f32d71fa5bd7f9366a748cc8f62fa51ecee08f48c9f021f867c1" }, "length": 847, - "version": 3 + "version": 1 } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json deleted file mode 120000 index fb4fe81b..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json new file mode 100644 index 00000000..a8d7bc02 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "9e36e50d82e225e3337bd0f3ae260956903e5123f220a76eaf99cec7c44b1a94c88a80b36cf041da90b72b7b78871f057cf3b13f982efe5962f73c0faf560306" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.snapshot.json new file mode 100644 index 00000000..80b36f79 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "175223d8af0a3b099ec857656649593c89b5b8a4347a0a336b5145cac28be2820654ae842ff9404894b89a1da865f6c0a085952de0c6bde8c499cc8736f3700d" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "ca3f0cf77fe17d4e181ee06daf7ce0aa825b83132afce001f49c0ed5ab7df795308d793df727cffde0d1afa0fb2557ff3c3bac838a0765f0ca94bdb6199bd4bc" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "fb06e93fead26c298bf8f4e8cecfad541ef05d8ce3e81d7c552d85ea283764fac4e72f9ef7ffbbac6760136e75e4920dddafcb1e8aede331e0394eb5f018f3c6" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.targets.json new file mode 100644 index 00000000..95b36aaf --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "303d34ef498da6101c8109af0537d345a4ddb7f0f4337180549d6309a8b6939d6ef268df205614e8e99138c6254b5c4f2b5119abaea4b3d8b7114d40979c190a" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "3": { + "hashes": { + "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/2.root.json deleted file mode 120000 index 55f8b9d4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/3.root.json deleted file mode 120000 index b4564b7f..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/4.root.json deleted file mode 100644 index a54c8546..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/4.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "3004c4b60645c6cca18e33835837a1639eead05355aa549f1d1304a22304e7058a50fb6188fc3617a47248eb7481de7a625f036cc69b53daf04a103b12768401" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 4 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/root.json index a54c8546..a8d7bc02 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/root.json @@ -2,12 +2,12 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "3004c4b60645c6cca18e33835837a1639eead05355aa549f1d1304a22304e7058a50fb6188fc3617a47248eb7481de7a625f036cc69b53daf04a103b12768401" + "sig": "9e36e50d82e225e3337bd0f3ae260956903e5123f220a76eaf99cec7c44b1a94c88a80b36cf041da90b72b7b78871f057cf3b13f982efe5962f73c0faf560306" } ], "signed": { "_type": "root", - "consistent_snapshot": false, + "consistent_snapshot": true, "expires": "2100-01-01T00:00:00Z", "keys": { "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/snapshot.json index 8d405926..80b36f79 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "5d310cc0b9cf6bf9c15b3d35020676b41dad6ae75405ec61cd299a697397fa4140c8718da6f0303708dd49e71d5f3702dae32289d1d7e34890073f90367bf109" + "sig": "175223d8af0a3b099ec857656649593c89b5b8a4347a0a336b5145cac28be2820654ae842ff9404894b89a1da865f6c0a085952de0c6bde8c499cc8736f3700d" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "8a9faf25965186fd6f131ba4d7c81c77c814e3ca7d18add76f952ab2ef3fa5aa8600a3511e784aff6156626a1e856b48d0bb085b93b5c3b30f24d2f56c4b303d" + "sha512": "ca3f0cf77fe17d4e181ee06daf7ce0aa825b83132afce001f49c0ed5ab7df795308d793df727cffde0d1afa0fb2557ff3c3bac838a0765f0ca94bdb6199bd4bc" }, - "length": 2178, - "version": 4 + "length": 2177, + "version": 1 }, "targets.json": { "hashes": { - "sha512": "75cc15d5a7c20656e37ece0a339434922fb489cf79f8ddf6a11d8c2a797ba1c7c51da0efaf335b31f9185c1eb9a5bbd074e16d412983a104e3bd33877eeb54c3" + "sha512": "fb06e93fead26c298bf8f4e8cecfad541ef05d8ce3e81d7c552d85ea283764fac4e72f9ef7ffbbac6760136e75e4920dddafcb1e8aede331e0394eb5f018f3c6" }, - "length": 1191, - "version": 4 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets.json index 88bb26e2..95b36aaf 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets.json @@ -2,32 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "7bfe0a63ee324034807b5341336d9d2d64e9ef3936086577b5bbcc6d021b4656bd6bf14d817bbb3908e4dcb05391d1b4031b527c14d942c2d1e38275d5ff1308" + "sig": "303d34ef498da6101c8109af0537d345a4ddb7f0f4337180549d6309a8b6939d6ef268df205614e8e99138c6254b5c4f2b5119abaea4b3d8b7114d40979c190a" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, "3": { "hashes": { "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" @@ -35,6 +19,6 @@ "length": 1 } }, - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/0 b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/0 deleted file mode 120000 index 2e6dba05..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/0 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/1 b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/1 deleted file mode 120000 index 14fee5d8..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/1 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/2 b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/2 deleted file mode 120000 index dcd19e04..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/2 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/3 b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 similarity index 100% rename from client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/3 rename to client/testdata/go-tuf/consistent-snapshot-false/3/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/timestamp.json index 70ffa072..7e2bba36 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/3/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/3/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "92dede82d29dc862dbcd8f263880c1ed4140e54859feb2a985ea7efd95c040f443aa1057e2d91ddc6f7dc6618b9d6828e3744a681f658effd1f79f2989fcfa01" + "sig": "6752b4fd8c106bcbe63f7e19475f976ed6e56e9efdbd114c0953b95ae352b982b79f0c28d3c891830127b8a1b0e913b98f9f36b2a0ae13541a9aaf18e6c9be06" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "1e7a837c1f6cf3f3a9bdf31869cc6fd6e146cba5065c438702d3225e8c0a4fef3d33148c8b41a1f86a15925c2032f7007d918c01794a3885d24801fa6a925904" + "sha512": "f854478d6ecd5ee43c159437761c84ae0a5d3aa515a71f9331ddf26f468f89700471135546bd3284054876c0ae1a336c871b76f77d088507635773bc5f6bf59b" }, - "length": 848, - "version": 4 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json deleted file mode 120000 index 741d2189..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json new file mode 100644 index 00000000..706ee6bc --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "dbf58a65ede5376df919fc15874289ad8f0cb87d3fde3bd1ffebc1a29d63fafd5f82fefd6281b954ae56798aaa3e43038fdee46450c3983c2912ca4482160f08" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "3ab34b0c2d4eadccaa0f0cf22ced07b552394063a9de2806993d022360dffc76" + }, + "scheme": "ed25519" + }, + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.snapshot.json new file mode 100644 index 00000000..597383fc --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "7fd83d3e7e9d55a7b4017e052d07a21139bb2d6080fefea67c012a1ca7bae172227c2fe9f5368f6de97c50ec6b2c807e411b29736ac39a717fe6e2c9a5ba6b03" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "3e27545965635c0f81583fe840c2546887ca1bccaa6a089a0fa268981b8b13d38a2857282cad6ef0ea5b3ad049eb6e10407bb3b0308ce07b39331ecd2899bc51" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.targets.json new file mode 100644 index 00000000..2147f430 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "970221ba14650f6ace2ecb1977201908684e5aae2e6d2143f5f3a804535da8c790c2f9874fe77b5b3ab960b113db70f5b9a949d29fdae05220c4251c3bbdef00" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "4": { + "hashes": { + "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/2.root.json deleted file mode 120000 index fb9b350d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/3.root.json deleted file mode 120000 index 65e6c5b4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/4.root.json deleted file mode 120000 index c3662ce8..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/4.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/4.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/5.root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/5.root.json deleted file mode 100644 index eafaf052..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/5.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "bd2edde6ba4f5cb3a0cc28dca272e2fc0be691575082479f86b82cea4e541a686a0c132c3a7eca231a5782e52e629df92f8f3f89a5b1f57e8b5368986bddfa0e" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": false, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "3ab34b0c2d4eadccaa0f0cf22ced07b552394063a9de2806993d022360dffc76" - }, - "scheme": "ed25519" - }, - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 5 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/root.json index eafaf052..706ee6bc 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/root.json @@ -2,12 +2,12 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "bd2edde6ba4f5cb3a0cc28dca272e2fc0be691575082479f86b82cea4e541a686a0c132c3a7eca231a5782e52e629df92f8f3f89a5b1f57e8b5368986bddfa0e" + "sig": "dbf58a65ede5376df919fc15874289ad8f0cb87d3fde3bd1ffebc1a29d63fafd5f82fefd6281b954ae56798aaa3e43038fdee46450c3983c2912ca4482160f08" } ], "signed": { "_type": "root", - "consistent_snapshot": false, + "consistent_snapshot": true, "expires": "2100-01-01T00:00:00Z", "keys": { "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/snapshot.json index d4603795..597383fc 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "b7da47fb77166cf71ed690476858ac830534e9528230c6cf9c76ca3f1821377c7036ca1e9aeffe4bf6ad178b99e5bb1cb65c4c175ec38c6f8e63f2d802be0a02" + "sig": "7fd83d3e7e9d55a7b4017e052d07a21139bb2d6080fefea67c012a1ca7bae172227c2fe9f5368f6de97c50ec6b2c807e411b29736ac39a717fe6e2c9a5ba6b03" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "2446f097fb62a5dc304044b981e3933ae72c050a01199d79d59a91fbbb22a6283b093e8c71c8d812a62dbe5e02be97e61a85a0c1ff1aa5f4323462b27d843a19" + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" }, - "length": 2178, - "version": 5 + "length": 2177, + "version": 1 }, "targets.json": { "hashes": { - "sha512": "6832a32afe35bb07557081f3a935296cde39c39f6bca65bd068c337743b570818ff6c04a968a40b83228b46d214b44528719babfa3314658df36d4b21b0757ae" + "sha512": "3e27545965635c0f81583fe840c2546887ca1bccaa6a089a0fa268981b8b13d38a2857282cad6ef0ea5b3ad049eb6e10407bb3b0308ce07b39331ecd2899bc51" }, - "length": 1392, - "version": 5 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets.json index f88f955a..2147f430 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets.json @@ -2,38 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "68f2346cdbe045e8558b2ccd86be66e15466955167557c704b51d7163838f670c53ab9247c16a4ed0cd4ecc981a7e2a04a350b01548f97654499d6f9c17c4202" + "sig": "970221ba14650f6ace2ecb1977201908684e5aae2e6d2143f5f3a804535da8c790c2f9874fe77b5b3ab960b113db70f5b9a949d29fdae05220c4251c3bbdef00" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, "4": { "hashes": { "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" @@ -41,6 +19,6 @@ "length": 1 } }, - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/0 b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/0 deleted file mode 120000 index efe18e41..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/0 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/1 b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/1 deleted file mode 120000 index b4a40c47..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/1 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/2 b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/2 deleted file mode 120000 index 1c681715..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/2 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/3 b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/3 deleted file mode 120000 index 1dc4d27e..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/3 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/3 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/4 b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 similarity index 100% rename from client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/4 rename to client/testdata/go-tuf/consistent-snapshot-false/4/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/timestamp.json index 7a98924d..303607ac 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/4/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/4/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315", - "sig": "5b4df3ec23ea00d0fb1bea862d4b1e9666cf2c4d3c9a7b2d9f4df30ba56efe096ac6b9d5969e64f0c8b1883f990e12d17ed4d024aa68a1714913c5aabfbb0504" + "sig": "3cfba81ebfe9099dc526010423f13becf80eca56ee5a6097826f6df410750d3a5544d81dc0f67c718ee2e525c79ec0a7af1545d50159dd28956a6f42db4c2a01" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "9ceab6e28e292fe87c94348762a7ba428929b6fbce3161ddb9b64fb139047973f1a1a0a58c861b6ea58e72f9e576ffcffc9b8da7f613e9cc29145dd7f5819768" + "sha512": "e9da83b07b70bdb8368680cbdfebb52dc0ad5967c3bd60c41acd199d4c38c1bcdf91be097caa3a2cb4f858b681593289b07fdb92b205c7e16b1211ade73d30b7" }, - "length": 848, - "version": 5 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.snapshot.json new file mode 100644 index 00000000..88b3471d --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "fcc27e4912f2d4b60b38f6e789e3fdcda613454f65c2fb3c9f731590ce264c58bdf8e63a4a6a7dbf1a32985ad922927c52b41f425d8f10b6b15819ec1c60b604" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "1c315f6a68ebae4f7111b84a8bc37286db208682be793663a266efcc8a0c17d7d4bda588bb413aed88b4bdf80eb8e266a2deb5b09d2efd10400d0acdb8bfda0f" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.targets.json new file mode 100644 index 00000000..404b7213 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "7572ba79949d790e8e52a01d44b8380bef53de5c8fbf8c5fd2de23cf2cb8d369d9b8ba6e77362b080df306497efa5b29dc5f5fdea36fd8b25bd37a6328f2e906" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "5": { + "hashes": { + "sha512": "06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/2.root.json deleted file mode 120000 index 5a3e4546..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/3.root.json deleted file mode 120000 index d1cb2513..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/4.root.json deleted file mode 120000 index bda6d089..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/4.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/4.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/5.root.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/5.root.json deleted file mode 120000 index f99552a4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/5.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/5.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/snapshot.json index 791dc121..88b3471d 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "bcf2c68335b1488f103828970d5b077c09009071defea99484dbdb7c4aea1c3d20a3086071d14fc153781693dbbadca55b8d31e6f3af9738c2b56af22d3f1903" + "sig": "fcc27e4912f2d4b60b38f6e789e3fdcda613454f65c2fb3c9f731590ce264c58bdf8e63a4a6a7dbf1a32985ad922927c52b41f425d8f10b6b15819ec1c60b604" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "2446f097fb62a5dc304044b981e3933ae72c050a01199d79d59a91fbbb22a6283b093e8c71c8d812a62dbe5e02be97e61a85a0c1ff1aa5f4323462b27d843a19" + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" }, - "length": 2178, - "version": 5 + "length": 2177, + "version": 1 }, "targets.json": { "hashes": { - "sha512": "97c2b46ccae4c2338d99819425239796c6647bf242ac64f13ec9347ec38fd8c6a5470756c079e1aaa23a013a8a720440f3128bd6c99f3c9f32492dd829726eee" + "sha512": "1c315f6a68ebae4f7111b84a8bc37286db208682be793663a266efcc8a0c17d7d4bda588bb413aed88b4bdf80eb8e266a2deb5b09d2efd10400d0acdb8bfda0f" }, - "length": 1593, - "version": 6 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets.json index 597f8dc3..404b7213 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets.json @@ -2,44 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "1e80ae84c4badf194e2fd7225c120999d8f628598fa0e994a2ff7cac705ec2f14601a64ba5370fc668f3fb114975dd81c554400d757f41762c4e12eb4db35d02" + "sig": "7572ba79949d790e8e52a01d44b8380bef53de5c8fbf8c5fd2de23cf2cb8d369d9b8ba6e77362b080df306497efa5b29dc5f5fdea36fd8b25bd37a6328f2e906" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, - "4": { - "hashes": { - "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" - }, - "length": 1 - }, "5": { "hashes": { "sha512": "06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25" @@ -47,6 +19,6 @@ "length": 1 } }, - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/0 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/0 deleted file mode 120000 index 94cc2872..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/0 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/5 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25.5 similarity index 100% rename from client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/5 rename to client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25.5 diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/1 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/1 deleted file mode 120000 index 51c7c9a9..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/1 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/2 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/2 deleted file mode 120000 index 46e3032e..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/2 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/3 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/3 deleted file mode 120000 index ca268e91..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/3 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/3 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/4 b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/4 deleted file mode 120000 index 19339ad4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/targets/4 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/4 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/timestamp.json index d0de0a38..350d90c9 100644 --- a/client/testdata/go-tuf/consistent-snapshot-false/5/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-false/5/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315", - "sig": "87187a6d32aec086baf0cd0b15d9bf86735bb5397ee3f465794aef908ec47d33bb4d3a834d8c1d1d9b5c6d18b649549995712ba1f9b688184ffb26944b2bcd04" + "sig": "99c4adf2a24202fbf1917b2aa7574fa34ac0da8208abc0779bcc3c414a852a1eb74ecd2611db9fae5fcbda75ea4ded7bb33492abc28e1df30335354db1d15304" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "ddbc5e4ece52ff8c0e9ac079c757a050f80c8997694d7e04516f12346e31b8b34d323a1efea5ec021e2e10a721058bebc5f8980743e6a52df869705c0683cf2e" + "sha512": "60c27719cf4db912cd4c9be09a774d7993c8316796e5639d128174daf30a77991588226f2e12048103a752fa5e35c3825b7eed2f4b4d502f5173007d09273e18" }, - "length": 848, - "version": 6 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.snapshot.json index d0239f13..3251c872 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "6813463556f5297c0cb33d417b974cbb2c6017b904728233a93776802befacf9cade0c95abcce9600e469b8c5820f22ef07b965bd4f59519f75621a72e33950e" + "sig": "5ee9e0e3e04b54e11ecf8885244e6068a1d864fe946d8d0b9ce400d1133d9e9a02112d36ec4ef4c180db43ad0693b95dd2e2bb34701d3e314e699ab81a494201" } ], "signed": { @@ -18,9 +18,9 @@ }, "targets.json": { "hashes": { - "sha512": "e0dd9a3833d117cd7bb6fdaae8923d5bda0661cb242be067813bfec3114d83943230b8bb7fcbf093a15d5840f1ecd969f44d3df13e2045d3fb7d22903fbc1bf5" + "sha512": "0f7aa68c338c27c00f83713965452237cfc83faf679546d3e21559492d9d382d36a3bfb8465342570de8abc703aad607c07c28d3d6e24745914e5aa445642b61" }, - "length": 588, + "length": 617, "version": 1 } }, diff --git a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.targets.json index 5bb513ff..96886aac 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/1.targets.json @@ -2,12 +2,14 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "4d5c3a5da43f3792d077c1128fa28585982ff2957fae59be02a831fc920d0b91cbeaa99fd6c15066ec4da8bf12f993440a90d1624fd7b0a68070e5d60ed2500f" + "sig": "5b27c3637faed11eb96662b2801a06045afbd4500d4f4e40c3c2a7d06dd578a33fa5fdf785f23550286d395d48c5cfbd862aec3d2da62e579192bdeda862ee09" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { "0": { diff --git a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/snapshot.json index d0239f13..3251c872 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "6813463556f5297c0cb33d417b974cbb2c6017b904728233a93776802befacf9cade0c95abcce9600e469b8c5820f22ef07b965bd4f59519f75621a72e33950e" + "sig": "5ee9e0e3e04b54e11ecf8885244e6068a1d864fe946d8d0b9ce400d1133d9e9a02112d36ec4ef4c180db43ad0693b95dd2e2bb34701d3e314e699ab81a494201" } ], "signed": { @@ -18,9 +18,9 @@ }, "targets.json": { "hashes": { - "sha512": "e0dd9a3833d117cd7bb6fdaae8923d5bda0661cb242be067813bfec3114d83943230b8bb7fcbf093a15d5840f1ecd969f44d3df13e2045d3fb7d22903fbc1bf5" + "sha512": "0f7aa68c338c27c00f83713965452237cfc83faf679546d3e21559492d9d382d36a3bfb8465342570de8abc703aad607c07c28d3d6e24745914e5aa445642b61" }, - "length": 588, + "length": 617, "version": 1 } }, diff --git a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/targets.json index 5bb513ff..96886aac 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/targets.json @@ -2,12 +2,14 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "4d5c3a5da43f3792d077c1128fa28585982ff2957fae59be02a831fc920d0b91cbeaa99fd6c15066ec4da8bf12f993440a90d1624fd7b0a68070e5d60ed2500f" + "sig": "5b27c3637faed11eb96662b2801a06045afbd4500d4f4e40c3c2a7d06dd578a33fa5fdf785f23550286d395d48c5cfbd862aec3d2da62e579192bdeda862ee09" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { "0": { diff --git a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/timestamp.json index 6c539db5..de5d9930 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/0/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/0/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "77c9f3881607266b0fbd6cbef1714e0acef5f55bd6cfbf21751e3891ced9e29c1fc6b145f850a9a4202baa15936880e01a9949a7b5eb4cefe000cf64b389c500" + "sig": "9df89093d7e181724bf01168ae6b188f12245dfbc26a9a93b913f29d737c76f954e13cedad8ef665124aa39f0b3dbfa29d9d7206f17f5e20be129706c26efa0e" } ], "signed": { @@ -11,7 +11,7 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "1e6d2300378eb7f5759f5d0ea98ea2dcb813cf9e8a5b35920e22f338da66e883a5cb53678039ada440c6f75752fdc356e4e0d05bbff639634bc578a6f71c3a62" + "sha512": "9da40fada276a5479c25bea4961a682352e18e41647dfff68386fc3889ac16bd5104652d87cca8fb88eb324f5ff2770f0ba3db61a54c491eddc8a76beb9bedae" }, "length": 847, "version": 1 diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json deleted file mode 120000 index 0ffd2b6d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../0/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json new file mode 100644 index 00000000..a10e5357 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.root.json @@ -0,0 +1,91 @@ +{ + "signatures": [ + { + "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", + "sig": "6658129fea318671119384ba07d53121ad14981730f1e6761c18358140fc1aa2ff8cfec9a50ce46642aa55d55369ce0ccec0aa7d3dea224ead3971747e58670a" + }, + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "4e19bc38c94625d5a1c8a396f07e1d37fadbffdd95b705ec3a7b141558dbf059c139d0355bb519314e7396d36f798d65bebe176d0144f0949f2a20eefd9f840c" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" + }, + "scheme": "ed25519" + }, + "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "62f71f99c788f16bcdc8bb252455e3a690350e4ddea5a6aab1f9a3aaabcf369a" + }, + "scheme": "ed25519" + }, + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json deleted file mode 120000 index 840f843e..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../0/repository/1.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json new file mode 100644 index 00000000..855a8ea9 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", + "sig": "fe745ed57ec6feb0aec1e5b8c67ea7ae26185dba9111204f2952fa523b6f6c2a9ed68dfe51175a1a3baf25d67e9e0f287512c0bd5c25009d43f57b50143f5808" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "0b7689274ac6797eda6447844d05d4b871c956394d0fa3476dd5a994a24534f2b929df60f2e2c5634ae5ab475efe30c1b41aa4c6625ca93e79616e435c81e842" + }, + "length": 2407, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "d8a4f0e52621223c32ce8c3f2d12947db366140f7e8ea9b4fecd3467979ce0fcfc7145f1bb208676783cfc0a96d02939bc27ea718e6046b2912b7a3d3d0cae54" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json deleted file mode 120000 index 4d11148d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../0/repository/1.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json new file mode 100644 index 00000000..83de5b99 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", + "sig": "92717aef431db4413db775f52e64a74b81e6c3e9883a3527a431f41668114a885c15b71c77a5cbbdbb4271ad00e404bc68b773ae017c38d3864fc4df4c382f05" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "1": { + "hashes": { + "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.root.json deleted file mode 100644 index 507dd26e..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.root.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "signatures": [ - { - "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", - "sig": "e560f386c0c270bb44cedda965ad21526e65162b41a2c30d84fb3a80f58913432e8dc74e5e7b0635ccdf51a2b951dae3b0ba28b4aac4088641a2b2cd2933dd04" - }, - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "7ac71619b21fe3a076fbbf3e17f92177c5374f005c32f1818e7c92eee107e3c726ccf906e800878035a9caf7679610147d72cb515cd76164b08b5c8bf93c0f0e" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": true, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" - }, - "scheme": "ed25519" - }, - "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "62f71f99c788f16bcdc8bb252455e3a690350e4ddea5a6aab1f9a3aaabcf369a" - }, - "scheme": "ed25519" - }, - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.snapshot.json deleted file mode 100644 index b3ca7777..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/2.snapshot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "signatures": [ - { - "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "25c7977a662d4cd511eb348284a0420eb62e654f90e10338e0653bc2f7428af8033818ba2901734956112bdcf95ebfd9f86070c6ed75ae4c3a21ebf7098b1f04" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2100-01-01T00:00:00Z", - "meta": { - "root.json": { - "hashes": { - "sha512": "645840e3191d531617ebab3de88e77461f1ff673cd6c857f23f87860e61ab6d80880933bb2b4f353dd89894c84b3497e3e02d791eaaab3750f4beabbba763c7a" - }, - "length": 2407, - "version": 2 - }, - "targets.json": { - "hashes": { - "sha512": "8672c435a53519972738fada6ed3b7fa37b3ea42b4fa1e436b774e697a8d696d9efbeb6c590a6e16dec0a5e7f789da82ea59a68fae63f343340d1549a075ab1b" - }, - "length": 789, - "version": 2 - } - }, - "spec_version": "1.0", - "version": 2 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/root.json index 507dd26e..a10e5357 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/root.json @@ -2,11 +2,11 @@ "signatures": [ { "keyid": "ce72db3f938914205461a415c9b7b91267a2079df991fd6283aa8461988c1add", - "sig": "e560f386c0c270bb44cedda965ad21526e65162b41a2c30d84fb3a80f58913432e8dc74e5e7b0635ccdf51a2b951dae3b0ba28b4aac4088641a2b2cd2933dd04" + "sig": "6658129fea318671119384ba07d53121ad14981730f1e6761c18358140fc1aa2ff8cfec9a50ce46642aa55d55369ce0ccec0aa7d3dea224ead3971747e58670a" }, { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "7ac71619b21fe3a076fbbf3e17f92177c5374f005c32f1818e7c92eee107e3c726ccf906e800878035a9caf7679610147d72cb515cd76164b08b5c8bf93c0f0e" + "sig": "4e19bc38c94625d5a1c8a396f07e1d37fadbffdd95b705ec3a7b141558dbf059c139d0355bb519314e7396d36f798d65bebe176d0144f0949f2a20eefd9f840c" } ], "signed": { @@ -86,6 +86,6 @@ } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/snapshot.json index b3ca7777..855a8ea9 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "25c7977a662d4cd511eb348284a0420eb62e654f90e10338e0653bc2f7428af8033818ba2901734956112bdcf95ebfd9f86070c6ed75ae4c3a21ebf7098b1f04" + "sig": "fe745ed57ec6feb0aec1e5b8c67ea7ae26185dba9111204f2952fa523b6f6c2a9ed68dfe51175a1a3baf25d67e9e0f287512c0bd5c25009d43f57b50143f5808" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "645840e3191d531617ebab3de88e77461f1ff673cd6c857f23f87860e61ab6d80880933bb2b4f353dd89894c84b3497e3e02d791eaaab3750f4beabbba763c7a" + "sha512": "0b7689274ac6797eda6447844d05d4b871c956394d0fa3476dd5a994a24534f2b929df60f2e2c5634ae5ab475efe30c1b41aa4c6625ca93e79616e435c81e842" }, "length": 2407, - "version": 2 + "version": 1 }, "targets.json": { "hashes": { - "sha512": "8672c435a53519972738fada6ed3b7fa37b3ea42b4fa1e436b774e697a8d696d9efbeb6c590a6e16dec0a5e7f789da82ea59a68fae63f343340d1549a075ab1b" + "sha512": "d8a4f0e52621223c32ce8c3f2d12947db366140f7e8ea9b4fecd3467979ce0fcfc7145f1bb208676783cfc0a96d02939bc27ea718e6046b2912b7a3d3d0cae54" }, - "length": 789, - "version": 2 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets.json index be817137..83de5b99 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets.json @@ -2,20 +2,16 @@ "signatures": [ { "keyid": "808aa256a8172bb0cb961767c6768e55ccf732c99afccc6145752d7a328b7937", - "sig": "81bcf5921834a20b8b0946815ad4316f43ffce20b3793e6653dc5fd4b98f1c6318ce2243948574e82414a102717a6f2d731250b3191c54abc8391fd867503e0b" + "sig": "92717aef431db4413db775f52e64a74b81e6c3e9883a3527a431f41668114a885c15b71c77a5cbbdbb4271ad00e404bc68b773ae017c38d3864fc4df4c382f05" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, "1": { "hashes": { "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" @@ -23,6 +19,6 @@ "length": 1 } }, - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 deleted file mode 120000 index b0c459f9..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 +++ /dev/null @@ -1 +0,0 @@ -../../../0/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/timestamp.json index ac084d4f..0bb94671 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/1/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/1/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "d2674f7afdfd013c9a8bdaf716db22521ce3929cb35917893ebae679a789d30ce875a4657c39906883766b5b80efe3ff96835fcbe704e08fda0e8887c936650f" + "sig": "6d39b875eefff71abb4137ddd673d8599fca75e827012de9fff335621cf8a3cfef2de7289aafdea7dfba7f40ec2f6709293bdced891217f141527d930915d708" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "e03715cdd4fc212599d320b3392052e1c452b3426d5658c9faee72b31df65e80823f42cb8649fae4d950f73736492a501e5f4569741d102386a4cb5194512b91" + "sha512": "4f7cb7d5dacf838f0d19b6ddea263d7b0646b8f930705192536224bc2f95f03f84cb23b364edaaf9bb7ef75ebbff6e268938e7ed2c02276a206846fdf98373d1" }, "length": 847, - "version": 2 + "version": 1 } }, "spec_version": "1.0", - "version": 2 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json deleted file mode 120000 index cd730513..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json new file mode 100644 index 00000000..3a288055 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "4842fe74732b866401ef512ca8f4536cc49ca38ea7eecd5f015ad33395a7d605f3627e51ecb079ac53806fdf5b3820c2c42fce285714806e1f4dded689c3e50c" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" + }, + "scheme": "ed25519" + }, + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json deleted file mode 120000 index 1307f574..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/1.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json new file mode 100644 index 00000000..775f7de0 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", + "sig": "5bcd230edaf5a974ce55aaadb6f2ce90544b57729e96cb0b8f8118e671755a1f1754639f8148729b11658340a70c312a82ca119b89b24262de123eca92ccb905" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "463e1cb7766fd1187c80265671640d34d39e07d664a60917fb78921368a672439550a9823f758ab3f9def27a5ab8040299096e688901438e32ead01f1bbb6436" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "b1f1bc5aea0672971cd2b8f5d3fdf74a7fc6ddbe2dce8408966c6d0864b970fc13a3ad8b114cea6fa2669c5a5c33483a5f46670dee89e2f94202a102f19786e5" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json deleted file mode 120000 index 85e1ecc2..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/1.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json new file mode 100644 index 00000000..da26a1f5 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "a49fa1e796c9c8f7722e079f08fbc2e691cfb0e2149bbc0f17bc90de9022e5c9133fd28355ab6420bca6d8dd2118294ad561d270a5b3c5d19778b11a57ef140d" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "2": { + "hashes": { + "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.root.json deleted file mode 120000 index bbdcb128..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.snapshot.json deleted file mode 120000 index 24d10752..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/2.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.targets.json deleted file mode 120000 index f6a17494..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/2.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../1/repository/2.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.root.json deleted file mode 100644 index 0695588c..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "475436056dca79fd151ae830ad2f4dbc7ecc5b146a79319c20a1167d4f214047d8f3847d1cda4ccd32a48acb13acbea55ba7e8254cffaa07e3de9ecdd0c13d03" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": true, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "d482fa4805a50870aa1356ace6b764f7ab47ed4dc38f49b1a189afa25f179e94" - }, - "scheme": "ed25519" - }, - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 3 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.snapshot.json deleted file mode 100644 index e7957f95..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.snapshot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "signatures": [ - { - "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "dd586784e6b6963bf9a5901e7c80eecb77fe0cddd33b553e227869337d52a8e36130f59973410aca5bb2caefcd13057e08b499bdfd720b22efd62fd995d2e309" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2100-01-01T00:00:00Z", - "meta": { - "root.json": { - "hashes": { - "sha512": "0f9a84fb34265274d9f68403c486b95e5fb27c38aad5252e22cfaf977a10c2cf780c1bee0ffa8bbfd350b835c608798ccfd8abb203034389194a353fe54ec486" - }, - "length": 2177, - "version": 3 - }, - "targets.json": { - "hashes": { - "sha512": "b103f5cd1d68e0b5f7b96af03a27cf971460977976cff0b1d1371dcce6d45ef78e183fa26bf886f3864e84b8ddbbfc1bab7bd0e2be180ad82ed26f22a8e9b68b" - }, - "length": 990, - "version": 3 - } - }, - "spec_version": "1.0", - "version": 3 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.targets.json deleted file mode 100644 index ad58a9d4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/3.targets.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "09593c7b47f4dbf1e8ac949fa010279ffbbd36070a54a89b689378441e8111602d4236fa2962063778c82027d4746a8973ba8fea86e9c105190da9fa362d8b0c" - } - ], - "signed": { - "_type": "targets", - "expires": "2100-01-01T00:00:00Z", - "spec_version": "1.0", - "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - } - }, - "version": 3 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/root.json index 0695588c..3a288055 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/root.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "475436056dca79fd151ae830ad2f4dbc7ecc5b146a79319c20a1167d4f214047d8f3847d1cda4ccd32a48acb13acbea55ba7e8254cffaa07e3de9ecdd0c13d03" + "sig": "4842fe74732b866401ef512ca8f4536cc49ca38ea7eecd5f015ad33395a7d605f3627e51ecb079ac53806fdf5b3820c2c42fce285714806e1f4dded689c3e50c" } ], "signed": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/snapshot.json index e7957f95..775f7de0 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "289e5a9e71afd7909326aa4caea92f7557ee0e2283d8c31f0c3401ce67248a45", - "sig": "dd586784e6b6963bf9a5901e7c80eecb77fe0cddd33b553e227869337d52a8e36130f59973410aca5bb2caefcd13057e08b499bdfd720b22efd62fd995d2e309" + "sig": "5bcd230edaf5a974ce55aaadb6f2ce90544b57729e96cb0b8f8118e671755a1f1754639f8148729b11658340a70c312a82ca119b89b24262de123eca92ccb905" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "0f9a84fb34265274d9f68403c486b95e5fb27c38aad5252e22cfaf977a10c2cf780c1bee0ffa8bbfd350b835c608798ccfd8abb203034389194a353fe54ec486" + "sha512": "463e1cb7766fd1187c80265671640d34d39e07d664a60917fb78921368a672439550a9823f758ab3f9def27a5ab8040299096e688901438e32ead01f1bbb6436" }, "length": 2177, - "version": 3 + "version": 1 }, "targets.json": { "hashes": { - "sha512": "b103f5cd1d68e0b5f7b96af03a27cf971460977976cff0b1d1371dcce6d45ef78e183fa26bf886f3864e84b8ddbbfc1bab7bd0e2be180ad82ed26f22a8e9b68b" + "sha512": "b1f1bc5aea0672971cd2b8f5d3fdf74a7fc6ddbe2dce8408966c6d0864b970fc13a3ad8b114cea6fa2669c5a5c33483a5f46670dee89e2f94202a102f19786e5" }, - "length": 990, - "version": 3 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets.json index ad58a9d4..da26a1f5 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets.json @@ -2,26 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "09593c7b47f4dbf1e8ac949fa010279ffbbd36070a54a89b689378441e8111602d4236fa2962063778c82027d4746a8973ba8fea86e9c105190da9fa362d8b0c" + "sig": "a49fa1e796c9c8f7722e079f08fbc2e691cfb0e2149bbc0f17bc90de9022e5c9133fd28355ab6420bca6d8dd2118294ad561d270a5b3c5d19778b11a57ef140d" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, "2": { "hashes": { "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" @@ -29,6 +19,6 @@ "length": 1 } }, - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 deleted file mode 120000 index de9aac3a..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 +++ /dev/null @@ -1 +0,0 @@ -../../../1/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 deleted file mode 120000 index 2ebb2d33..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 +++ /dev/null @@ -1 +0,0 @@ -../../../1/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/timestamp.json index 1c42c604..e18b091e 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/2/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/2/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "1060f67b6bec92d00fb357b6858ff059e091bf3a2a95a254902fba6be9e4b1677777c5665e82dc405d1877eeb6c08ad8333638f156a544a77591e0e81327f303" + "sig": "dfa4dffbddd403c0ab47d67061773b35c1d29766bca159724a6202eb15894de4d20cd44e1b8823582ae38676ab73ee36b713747d5a591db8a9654e0bbc63db07" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "49fd64f5351893d11f51f7b84b48b12b3b2e96ac5a73a1cdedb453ef7cfa6786deb8401ebedc71a7261879b740ef7eb5e37707ac7fcdedc4393b9322f828f2f8" + "sha512": "e5c4d07419c0216698fef07f0463d32503af32bf4ad110987dfa646dfebb294302c8bd49de21f32d71fa5bd7f9366a748cc8f62fa51ecee08f48c9f021f867c1" }, "length": 847, - "version": 3 + "version": 1 } }, "spec_version": "1.0", - "version": 3 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json deleted file mode 120000 index fb4fe81b..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json new file mode 100644 index 00000000..a8d7bc02 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "9e36e50d82e225e3337bd0f3ae260956903e5123f220a76eaf99cec7c44b1a94c88a80b36cf041da90b72b7b78871f057cf3b13f982efe5962f73c0faf560306" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" + }, + "scheme": "ed25519" + }, + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json deleted file mode 120000 index 4dfb0d02..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/1.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json new file mode 100644 index 00000000..80b36f79 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "175223d8af0a3b099ec857656649593c89b5b8a4347a0a336b5145cac28be2820654ae842ff9404894b89a1da865f6c0a085952de0c6bde8c499cc8736f3700d" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "ca3f0cf77fe17d4e181ee06daf7ce0aa825b83132afce001f49c0ed5ab7df795308d793df727cffde0d1afa0fb2557ff3c3bac838a0765f0ca94bdb6199bd4bc" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "fb06e93fead26c298bf8f4e8cecfad541ef05d8ce3e81d7c552d85ea283764fac4e72f9ef7ffbbac6760136e75e4920dddafcb1e8aede331e0394eb5f018f3c6" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json deleted file mode 120000 index 1eeb5642..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/1.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json new file mode 100644 index 00000000..95b36aaf --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "303d34ef498da6101c8109af0537d345a4ddb7f0f4337180549d6309a8b6939d6ef268df205614e8e99138c6254b5c4f2b5119abaea4b3d8b7114d40979c190a" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "3": { + "hashes": { + "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.root.json deleted file mode 120000 index 55f8b9d4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.snapshot.json deleted file mode 120000 index 65445cb4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/2.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.targets.json deleted file mode 120000 index 3600a0f4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/2.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/2.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.root.json deleted file mode 120000 index b4564b7f..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.snapshot.json deleted file mode 120000 index 7d86b95a..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/3.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.targets.json deleted file mode 120000 index d1df10e4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/3.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../2/repository/3.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.root.json deleted file mode 100644 index 2b2f50b8..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "15431a0217deb636e2e79876cfdfc8b78fdda1119e6c8512c7dc61af240a7d2303f172e7fc28de7dfe58d92c84f5118ccd09d0f29f49aaa3f7ef95edf21e2d0a" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": true, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "8656ad20568cd3534c405e4d9a84b0c6e6163f7f66434df77416502835b9b160" - }, - "scheme": "ed25519" - }, - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 4 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.snapshot.json deleted file mode 100644 index 12c4da70..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.snapshot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "8ff1cc44d0cf82291f63cb8b4baa1b1f3f2080f29dea7dd9b08c4be0a14412dc9afa7f823bfc2af5d3514049e522f19588be3f433fb936da0e16884d2f8d3601" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2100-01-01T00:00:00Z", - "meta": { - "root.json": { - "hashes": { - "sha512": "d99e7074aaec64f9b9747815bc695bda95b4c7a27ae9b0ec807f02cb36c3af5126198a2bdfb03a691913082eedcc809d4b6dd4afbb013936be02357f51f6313c" - }, - "length": 2177, - "version": 4 - }, - "targets.json": { - "hashes": { - "sha512": "75cc15d5a7c20656e37ece0a339434922fb489cf79f8ddf6a11d8c2a797ba1c7c51da0efaf335b31f9185c1eb9a5bbd074e16d412983a104e3bd33877eeb54c3" - }, - "length": 1191, - "version": 4 - } - }, - "spec_version": "1.0", - "version": 4 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.targets.json deleted file mode 100644 index 88bb26e2..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/4.targets.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "7bfe0a63ee324034807b5341336d9d2d64e9ef3936086577b5bbcc6d021b4656bd6bf14d817bbb3908e4dcb05391d1b4031b527c14d942c2d1e38275d5ff1308" - } - ], - "signed": { - "_type": "targets", - "expires": "2100-01-01T00:00:00Z", - "spec_version": "1.0", - "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - } - }, - "version": 4 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/root.json index 2b2f50b8..a8d7bc02 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/root.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "15431a0217deb636e2e79876cfdfc8b78fdda1119e6c8512c7dc61af240a7d2303f172e7fc28de7dfe58d92c84f5118ccd09d0f29f49aaa3f7ef95edf21e2d0a" + "sig": "9e36e50d82e225e3337bd0f3ae260956903e5123f220a76eaf99cec7c44b1a94c88a80b36cf041da90b72b7b78871f057cf3b13f982efe5962f73c0faf560306" } ], "signed": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/snapshot.json index 12c4da70..80b36f79 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "8ff1cc44d0cf82291f63cb8b4baa1b1f3f2080f29dea7dd9b08c4be0a14412dc9afa7f823bfc2af5d3514049e522f19588be3f433fb936da0e16884d2f8d3601" + "sig": "175223d8af0a3b099ec857656649593c89b5b8a4347a0a336b5145cac28be2820654ae842ff9404894b89a1da865f6c0a085952de0c6bde8c499cc8736f3700d" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "d99e7074aaec64f9b9747815bc695bda95b4c7a27ae9b0ec807f02cb36c3af5126198a2bdfb03a691913082eedcc809d4b6dd4afbb013936be02357f51f6313c" + "sha512": "ca3f0cf77fe17d4e181ee06daf7ce0aa825b83132afce001f49c0ed5ab7df795308d793df727cffde0d1afa0fb2557ff3c3bac838a0765f0ca94bdb6199bd4bc" }, "length": 2177, - "version": 4 + "version": 1 }, "targets.json": { "hashes": { - "sha512": "75cc15d5a7c20656e37ece0a339434922fb489cf79f8ddf6a11d8c2a797ba1c7c51da0efaf335b31f9185c1eb9a5bbd074e16d412983a104e3bd33877eeb54c3" + "sha512": "fb06e93fead26c298bf8f4e8cecfad541ef05d8ce3e81d7c552d85ea283764fac4e72f9ef7ffbbac6760136e75e4920dddafcb1e8aede331e0394eb5f018f3c6" }, - "length": 1191, - "version": 4 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets.json index 88bb26e2..95b36aaf 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets.json @@ -2,32 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "7bfe0a63ee324034807b5341336d9d2d64e9ef3936086577b5bbcc6d021b4656bd6bf14d817bbb3908e4dcb05391d1b4031b527c14d942c2d1e38275d5ff1308" + "sig": "303d34ef498da6101c8109af0537d345a4ddb7f0f4337180549d6309a8b6939d6ef268df205614e8e99138c6254b5c4f2b5119abaea4b3d8b7114d40979c190a" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, "3": { "hashes": { "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" @@ -35,6 +19,6 @@ "length": 1 } }, - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 deleted file mode 120000 index f8203976..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 deleted file mode 120000 index 7cbcc2a6..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 deleted file mode 120000 index 180cdb4f..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 +++ /dev/null @@ -1 +0,0 @@ -../../../2/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/timestamp.json index 04bae5e9..7e2bba36 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/3/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/3/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "aa3255b4e8e17e566d2bdbea0e5842978f9fa1d2fa9ec76ae76b146164acbfc8", - "sig": "739949ce0e5fc4c154ec6e14a970ffc4f247288d14258c0165168a983cd232cf6b5390376d1189287e39de32d6524d4b6f6337174a53cb93a5fdfafe169ce201" + "sig": "6752b4fd8c106bcbe63f7e19475f976ed6e56e9efdbd114c0953b95ae352b982b79f0c28d3c891830127b8a1b0e913b98f9f36b2a0ae13541a9aaf18e6c9be06" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "7b3740e1c7207537f8f16d2172c5ea7ca3decc788c65855ef5343fac69fc92a20d46d785e6bf689e977503165241af4b8882f943ae02022306ef0d3a91cd825f" + "sha512": "f854478d6ecd5ee43c159437761c84ae0a5d3aa515a71f9331ddf26f468f89700471135546bd3284054876c0ae1a336c871b76f77d088507635773bc5f6bf59b" }, - "length": 848, - "version": 4 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 4 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json deleted file mode 120000 index 741d2189..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/1.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json new file mode 100644 index 00000000..706ee6bc --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", + "sig": "dbf58a65ede5376df919fc15874289ad8f0cb87d3fde3bd1ffebc1a29d63fafd5f82fefd6281b954ae56798aaa3e43038fdee46450c3983c2912ca4482160f08" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2100-01-01T00:00:00Z", + "keys": { + "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "3ab34b0c2d4eadccaa0f0cf22ced07b552394063a9de2806993d022360dffc76" + }, + "scheme": "ed25519" + }, + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" + }, + "scheme": "ed25519" + }, + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" + }, + "scheme": "ed25519" + }, + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json deleted file mode 120000 index f87f7ed7..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/1.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json new file mode 100644 index 00000000..597383fc --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "7fd83d3e7e9d55a7b4017e052d07a21139bb2d6080fefea67c012a1ca7bae172227c2fe9f5368f6de97c50ec6b2c807e411b29736ac39a717fe6e2c9a5ba6b03" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "3e27545965635c0f81583fe840c2546887ca1bccaa6a089a0fa268981b8b13d38a2857282cad6ef0ea5b3ad049eb6e10407bb3b0308ce07b39331ecd2899bc51" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json deleted file mode 120000 index b0002ec9..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/1.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json new file mode 100644 index 00000000..2147f430 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "970221ba14650f6ace2ecb1977201908684e5aae2e6d2143f5f3a804535da8c790c2f9874fe77b5b3ab960b113db70f5b9a949d29fdae05220c4251c3bbdef00" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "4": { + "hashes": { + "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.root.json deleted file mode 120000 index fb9b350d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.snapshot.json deleted file mode 120000 index e96983b5..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/2.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.targets.json deleted file mode 120000 index dbb2a759..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/2.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/2.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.root.json deleted file mode 120000 index 65e6c5b4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.snapshot.json deleted file mode 120000 index f2fd5601..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/3.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.targets.json deleted file mode 120000 index ca61e77d..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/3.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/3.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.root.json deleted file mode 120000 index c3662ce8..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.root.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/4.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.snapshot.json deleted file mode 120000 index a2f839ac..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/4.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.targets.json deleted file mode 120000 index 9f7a7841..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/4.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../3/repository/4.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.root.json deleted file mode 100644 index 955b19cd..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.root.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "2b6f30258eaf8b4b2d900a2efb4a597b45a9c0c5a0720d5521dd37d63c34d1db62aafaa1d95b6d881f9c991615ab68930c24ef247d2f45836bca3659e36d9c0b" - } - ], - "signed": { - "_type": "root", - "consistent_snapshot": true, - "expires": "2100-01-01T00:00:00Z", - "keys": { - "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "3ab34b0c2d4eadccaa0f0cf22ced07b552394063a9de2806993d022360dffc76" - }, - "scheme": "ed25519" - }, - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "722dbc861813bb5b568524d62083e875c08e66fed1694d9161d253fa163dd86f" - }, - "scheme": "ed25519" - }, - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "153986a7370e002f377dd68797e7466c421180c1571e233de2f8ab41c8af4f54" - }, - "scheme": "ed25519" - }, - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1": { - "keyid_hash_algorithms": [ - "sha256", - "sha512" - ], - "keytype": "ed25519", - "keyval": { - "public": "aee574e56780ea1709a8b56e02d4ffdd9a3a1deaed61e2eb0701f376a4422e42" - }, - "scheme": "ed25519" - } - }, - "roles": { - "root": { - "keyids": [ - "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f" - ], - "threshold": 1 - }, - "snapshot": { - "keyids": [ - "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef" - ], - "threshold": 1 - }, - "targets": { - "keyids": [ - "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1" - ], - "threshold": 1 - }, - "timestamp": { - "keyids": [ - "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315" - ], - "threshold": 1 - } - }, - "spec_version": "1.0", - "version": 5 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.snapshot.json deleted file mode 100644 index c646a7f5..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.snapshot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "cc836021c11c5ee44f9f343ce41f63766a9dfd8e4c3faaf58dc491235297b7408a43854ba2e3f6ecfc985d0f850b54c472b7b10a9db0a6fcaa69edc9db839d00" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2100-01-01T00:00:00Z", - "meta": { - "root.json": { - "hashes": { - "sha512": "520ac0efdb3539bc82380a5bf1dc759de3f823896f3762e4f351fff3a8d647f1534ca6281c5c3a7f69c280a62e2f9ae83121f0c88597cd78b0b1ce2ae9a79fad" - }, - "length": 2177, - "version": 5 - }, - "targets.json": { - "hashes": { - "sha512": "6832a32afe35bb07557081f3a935296cde39c39f6bca65bd068c337743b570818ff6c04a968a40b83228b46d214b44528719babfa3314658df36d4b21b0757ae" - }, - "length": 1392, - "version": 5 - } - }, - "spec_version": "1.0", - "version": 5 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.targets.json deleted file mode 100644 index f88f955a..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/5.targets.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "68f2346cdbe045e8558b2ccd86be66e15466955167557c704b51d7163838f670c53ab9247c16a4ed0cd4ecc981a7e2a04a350b01548f97654499d6f9c17c4202" - } - ], - "signed": { - "_type": "targets", - "expires": "2100-01-01T00:00:00Z", - "spec_version": "1.0", - "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, - "4": { - "hashes": { - "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" - }, - "length": 1 - } - }, - "version": 5 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/root.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/root.json index 955b19cd..706ee6bc 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/root.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/root.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b2403f96ae9b1089d8cbc15bbc35e9acbacd7984571f951b43aab56aedcfa84f", - "sig": "2b6f30258eaf8b4b2d900a2efb4a597b45a9c0c5a0720d5521dd37d63c34d1db62aafaa1d95b6d881f9c991615ab68930c24ef247d2f45836bca3659e36d9c0b" + "sig": "dbf58a65ede5376df919fc15874289ad8f0cb87d3fde3bd1ffebc1a29d63fafd5f82fefd6281b954ae56798aaa3e43038fdee46450c3983c2912ca4482160f08" } ], "signed": { @@ -82,6 +82,6 @@ } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/snapshot.json index c646a7f5..597383fc 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "cc836021c11c5ee44f9f343ce41f63766a9dfd8e4c3faaf58dc491235297b7408a43854ba2e3f6ecfc985d0f850b54c472b7b10a9db0a6fcaa69edc9db839d00" + "sig": "7fd83d3e7e9d55a7b4017e052d07a21139bb2d6080fefea67c012a1ca7bae172227c2fe9f5368f6de97c50ec6b2c807e411b29736ac39a717fe6e2c9a5ba6b03" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "520ac0efdb3539bc82380a5bf1dc759de3f823896f3762e4f351fff3a8d647f1534ca6281c5c3a7f69c280a62e2f9ae83121f0c88597cd78b0b1ce2ae9a79fad" + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" }, "length": 2177, - "version": 5 + "version": 1 }, "targets.json": { "hashes": { - "sha512": "6832a32afe35bb07557081f3a935296cde39c39f6bca65bd068c337743b570818ff6c04a968a40b83228b46d214b44528719babfa3314658df36d4b21b0757ae" + "sha512": "3e27545965635c0f81583fe840c2546887ca1bccaa6a089a0fa268981b8b13d38a2857282cad6ef0ea5b3ad049eb6e10407bb3b0308ce07b39331ecd2899bc51" }, - "length": 1392, - "version": 5 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets.json index f88f955a..2147f430 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets.json @@ -2,38 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "68f2346cdbe045e8558b2ccd86be66e15466955167557c704b51d7163838f670c53ab9247c16a4ed0cd4ecc981a7e2a04a350b01548f97654499d6f9c17c4202" + "sig": "970221ba14650f6ace2ecb1977201908684e5aae2e6d2143f5f3a804535da8c790c2f9874fe77b5b3ab960b113db70f5b9a949d29fdae05220c4251c3bbdef00" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, "4": { "hashes": { "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" @@ -41,6 +19,6 @@ "length": 1 } }, - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 deleted file mode 120000 index 8bca78fb..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 deleted file mode 120000 index 814339fc..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 deleted file mode 120000 index dc5c46dc..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 deleted file mode 120000 index 16b79678..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 +++ /dev/null @@ -1 +0,0 @@ -../../../3/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/timestamp.json index 69c46456..303607ac 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/4/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/4/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315", - "sig": "8dfecf93852c99731f81f9e3a34157591ce8f0e1012561b55fe63aa7914847aa7748bed775a89a6736ead746bfb4f578a60f5349126208af7052bc02ea2ca500" + "sig": "3cfba81ebfe9099dc526010423f13becf80eca56ee5a6097826f6df410750d3a5544d81dc0f67c718ee2e525c79ec0a7af1545d50159dd28956a6f42db4c2a01" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "f4aca6f10fc10646768cca2fb2d58557d6ba7baea954c8d911ff800311974681e52cfe50fc150b86bb224f1ca22ee53c9fb74ca8d55441ddb67e3261e2b2ca3f" + "sha512": "e9da83b07b70bdb8368680cbdfebb52dc0ad5967c3bd60c41acd199d4c38c1bcdf91be097caa3a2cb4f858b681593289b07fdb92b205c7e16b1211ade73d30b7" }, - "length": 848, - "version": 5 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 5 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json deleted file mode 120000 index f7fb0982..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/1.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json new file mode 100644 index 00000000..88b3471d --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.snapshot.json @@ -0,0 +1,30 @@ +{ + "signatures": [ + { + "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", + "sig": "fcc27e4912f2d4b60b38f6e789e3fdcda613454f65c2fb3c9f731590ce264c58bdf8e63a4a6a7dbf1a32985ad922927c52b41f425d8f10b6b15819ec1c60b604" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2100-01-01T00:00:00Z", + "meta": { + "root.json": { + "hashes": { + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" + }, + "length": 2177, + "version": 1 + }, + "targets.json": { + "hashes": { + "sha512": "1c315f6a68ebae4f7111b84a8bc37286db208682be793663a266efcc8a0c17d7d4bda588bb413aed88b4bdf80eb8e266a2deb5b09d2efd10400d0acdb8bfda0f" + }, + "length": 617, + "version": 1 + } + }, + "spec_version": "1.0", + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json deleted file mode 120000 index 127f6097..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/1.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json new file mode 100644 index 00000000..404b7213 --- /dev/null +++ b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/1.targets.json @@ -0,0 +1,24 @@ +{ + "signatures": [ + { + "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", + "sig": "7572ba79949d790e8e52a01d44b8380bef53de5c8fbf8c5fd2de23cf2cb8d369d9b8ba6e77362b080df306497efa5b29dc5f5fdea36fd8b25bd37a6328f2e906" + } + ], + "signed": { + "_type": "targets", + "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, + "spec_version": "1.0", + "targets": { + "5": { + "hashes": { + "sha512": "06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25" + }, + "length": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.root.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.root.json deleted file mode 120000 index 5a3e4546..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/2.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.snapshot.json deleted file mode 120000 index 5b418d6a..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/2.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.targets.json deleted file mode 120000 index 04b0be44..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/2.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/2.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.root.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.root.json deleted file mode 120000 index d1cb2513..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/3.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.snapshot.json deleted file mode 120000 index d23c05ca..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/3.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.targets.json deleted file mode 120000 index 2854154a..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/3.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/3.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.root.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.root.json deleted file mode 120000 index bda6d089..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/4.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.snapshot.json deleted file mode 120000 index b7aefb24..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/4.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.targets.json deleted file mode 120000 index fef64e45..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/4.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/4.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.root.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.root.json deleted file mode 120000 index f99552a4..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.root.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/5.root.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.snapshot.json deleted file mode 120000 index 4e98537c..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.snapshot.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/5.snapshot.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.targets.json deleted file mode 120000 index f8771442..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/5.targets.json +++ /dev/null @@ -1 +0,0 @@ -../../4/repository/5.targets.json \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.snapshot.json deleted file mode 100644 index da1c95df..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.snapshot.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "signatures": [ - { - "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "a32d2d190e9088327da8b56f758d7edfe103985e0616d8f3e0f30a7d9d646394648a2614ebbeb7c66dbca56011ea9fb9dc8eba1d2a2931a65829f63989461d07" - } - ], - "signed": { - "_type": "snapshot", - "expires": "2100-01-01T00:00:00Z", - "meta": { - "root.json": { - "hashes": { - "sha512": "520ac0efdb3539bc82380a5bf1dc759de3f823896f3762e4f351fff3a8d647f1534ca6281c5c3a7f69c280a62e2f9ae83121f0c88597cd78b0b1ce2ae9a79fad" - }, - "length": 2177, - "version": 5 - }, - "targets.json": { - "hashes": { - "sha512": "97c2b46ccae4c2338d99819425239796c6647bf242ac64f13ec9347ec38fd8c6a5470756c079e1aaa23a013a8a720440f3128bd6c99f3c9f32492dd829726eee" - }, - "length": 1593, - "version": 6 - } - }, - "spec_version": "1.0", - "version": 6 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.targets.json deleted file mode 100644 index 597f8dc3..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/6.targets.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "signatures": [ - { - "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "1e80ae84c4badf194e2fd7225c120999d8f628598fa0e994a2ff7cac705ec2f14601a64ba5370fc668f3fb114975dd81c554400d757f41762c4e12eb4db35d02" - } - ], - "signed": { - "_type": "targets", - "expires": "2100-01-01T00:00:00Z", - "spec_version": "1.0", - "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, - "4": { - "hashes": { - "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" - }, - "length": 1 - }, - "5": { - "hashes": { - "sha512": "06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25" - }, - "length": 1 - } - }, - "version": 6 - } -} \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/snapshot.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/snapshot.json index da1c95df..88b3471d 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/snapshot.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/snapshot.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "b096bc2d67080cec22e6c0bbaa69cfd9d714b9e9ad847d255f950b2728855fef", - "sig": "a32d2d190e9088327da8b56f758d7edfe103985e0616d8f3e0f30a7d9d646394648a2614ebbeb7c66dbca56011ea9fb9dc8eba1d2a2931a65829f63989461d07" + "sig": "fcc27e4912f2d4b60b38f6e789e3fdcda613454f65c2fb3c9f731590ce264c58bdf8e63a4a6a7dbf1a32985ad922927c52b41f425d8f10b6b15819ec1c60b604" } ], "signed": { @@ -11,20 +11,20 @@ "meta": { "root.json": { "hashes": { - "sha512": "520ac0efdb3539bc82380a5bf1dc759de3f823896f3762e4f351fff3a8d647f1534ca6281c5c3a7f69c280a62e2f9ae83121f0c88597cd78b0b1ce2ae9a79fad" + "sha512": "1f25d82e8e10d6ab9a2d1f8ffee142410e146044d6840ef17df9dd8bd59e7f1a8139aff84bb50b117495060601761681051ee08827e42e3cf5c287a648adc34a" }, "length": 2177, - "version": 5 + "version": 1 }, "targets.json": { "hashes": { - "sha512": "97c2b46ccae4c2338d99819425239796c6647bf242ac64f13ec9347ec38fd8c6a5470756c079e1aaa23a013a8a720440f3128bd6c99f3c9f32492dd829726eee" + "sha512": "1c315f6a68ebae4f7111b84a8bc37286db208682be793663a266efcc8a0c17d7d4bda588bb413aed88b4bdf80eb8e266a2deb5b09d2efd10400d0acdb8bfda0f" }, - "length": 1593, - "version": 6 + "length": 617, + "version": 1 } }, "spec_version": "1.0", - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets.json index 597f8dc3..404b7213 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets.json @@ -2,44 +2,16 @@ "signatures": [ { "keyid": "bc8f087663855564b358ddf314d5932ab920af17bd1df2f58b397afd82d76dc1", - "sig": "1e80ae84c4badf194e2fd7225c120999d8f628598fa0e994a2ff7cac705ec2f14601a64ba5370fc668f3fb114975dd81c554400d757f41762c4e12eb4db35d02" + "sig": "7572ba79949d790e8e52a01d44b8380bef53de5c8fbf8c5fd2de23cf2cb8d369d9b8ba6e77362b080df306497efa5b29dc5f5fdea36fd8b25bd37a6328f2e906" } ], "signed": { "_type": "targets", "expires": "2100-01-01T00:00:00Z", + "keys": {}, + "roles": {}, "spec_version": "1.0", "targets": { - "0": { - "hashes": { - "sha512": "31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99" - }, - "length": 1 - }, - "1": { - "hashes": { - "sha512": "4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a" - }, - "length": 1 - }, - "2": { - "hashes": { - "sha512": "40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114" - }, - "length": 1 - }, - "3": { - "hashes": { - "sha512": "3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb" - }, - "length": 1 - }, - "4": { - "hashes": { - "sha512": "a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568" - }, - "length": 1 - }, "5": { "hashes": { "sha512": "06df05371981a237d0ed11472fae7c94c9ac0eff1d05413516710d17b10a4fb6f4517bda4a695f02d0a73dd4db543b4653df28f5d09dab86f92ffb9b86d01e25" @@ -47,6 +19,6 @@ "length": 1 } }, - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 deleted file mode 120000 index c70b61bd..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99.0 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 deleted file mode 120000 index 1e66cb1b..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/3bafbf08882a2d10133093a1b8433f50563b93c14acd05b79028eb1d12799027241450980651994501423a66c276ae26c43b739bc65c4e16b10c3af6c202aebb.3 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 deleted file mode 120000 index a02a2316..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/40b244112641dd78dd4f93b6c9190dd46e0099194d5a44257b7efad6ef9ff4683da1eda0244448cb343aa688f5d3efd7314dafe580ac0bcbf115aeca9e8dc114.2 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 deleted file mode 120000 index 74d1328f..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a.1 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 deleted file mode 120000 index 73a65ad2..00000000 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 +++ /dev/null @@ -1 +0,0 @@ -../../../4/repository/targets/a321d8b405e3ef2604959847b36d171eebebc4a8941dc70a4784935a4fca5d5813de84dfa049f06549aa61b20848c1633ce81b675286ea8fb53db240d831c568.4 \ No newline at end of file diff --git a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/timestamp.json b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/timestamp.json index d0f96862..350d90c9 100644 --- a/client/testdata/go-tuf/consistent-snapshot-true/5/repository/timestamp.json +++ b/client/testdata/go-tuf/consistent-snapshot-true/5/repository/timestamp.json @@ -2,7 +2,7 @@ "signatures": [ { "keyid": "a8eaf6de5aecfd0a72b60295b1e1cd12f349079ebcbbb63dbe7072f162e85315", - "sig": "0aad2933e303b4b85dd680061b4b617a3833f35ad8a0e65aa3909879d73022342ebaaa885c7c45c5c305a6ab726f0ce255beb64af12c3ee81823ded8c135de04" + "sig": "99c4adf2a24202fbf1917b2aa7574fa34ac0da8208abc0779bcc3c414a852a1eb74ecd2611db9fae5fcbda75ea4ded7bb33492abc28e1df30335354db1d15304" } ], "signed": { @@ -11,13 +11,13 @@ "meta": { "snapshot.json": { "hashes": { - "sha512": "3510250ffbff04da4ad538411dc465fe771d2133716cd9e3eb1ca51f93fc83d2770f4e23573e781a96e4a0720d3e29a829343a0583c55586b3dfab35bac42c5c" + "sha512": "60c27719cf4db912cd4c9be09a774d7993c8316796e5639d128174daf30a77991588226f2e12048103a752fa5e35c3825b7eed2f4b4d502f5173007d09273e18" }, - "length": 848, - "version": 6 + "length": 847, + "version": 1 } }, "spec_version": "1.0", - "version": 6 + "version": 1 } } \ No newline at end of file diff --git a/client/testdata/go-tuf/generator/generator.go b/client/testdata/go-tuf/generator/generator.go index a1a616ee..dc973efa 100644 --- a/client/testdata/go-tuf/generator/generator.go +++ b/client/testdata/go-tuf/generator/generator.go @@ -6,7 +6,6 @@ import ( "io/ioutil" "log" "os" - "os/exec" "path/filepath" "time" @@ -27,11 +26,6 @@ func assertNotNil(err error) { } } -func copyRepo(src string, dst string) { - cmd := exec.Command("cp", "-r", src, dst) - assertNotNil(cmd.Run()) -} - func newRepo(dir string) *tuf.Repo { repo, err := tuf.NewRepoIndent(tuf.FileSystemStore(dir, nil), "", "\t") assertNotNil(err) @@ -92,13 +86,11 @@ func generateRepos(dir string, roleKeys map[string][][]*sign.PrivateKey, consist commit(dir0, repo0) // Rotate all the keys to make sure that works. - oldDir := dir0 i := 1 for _, role := range []string{"root", "targets", "snapshot", "timestamp"} { // Setup the repo. stepName := fmt.Sprintf("%d", i) d := filepath.Join(dir, stepName) - copyRepo(oldDir, d) repo := newRepo(d) addKeys(repo, keys) @@ -113,14 +105,12 @@ func generateRepos(dir string, roleKeys map[string][][]*sign.PrivateKey, consist addTargets(repo, d, map[string][]byte{stepName: []byte(stepName)}) commit(d, repo) - i += 1 - oldDir = d + i++ } // Add another target file to make sure the workflow worked. stepName := fmt.Sprintf("%d", i) d := filepath.Join(dir, stepName) - copyRepo(oldDir, d) repo := newRepo(d) addKeys(repo, keys) addTargets(repo, d, map[string][]byte{stepName: []byte(stepName)}) diff --git a/cmd/tuf/dele_add.go b/cmd/tuf/dele_add.go new file mode 100644 index 00000000..69370033 --- /dev/null +++ b/cmd/tuf/dele_add.go @@ -0,0 +1,36 @@ +package main + +import ( + "encoding/json" + + "github.com/flynn/go-docopt" + "github.com/theupdateframework/go-tuf" +) + +func init() { + register("dele-add", cmdDelegateAdd, ` +usage: tuf dele-add [--expires=] [--custom=] [...] + +Add target file(s) for a non-top target role, a name must be provided. + +Options: + --expires= Set the targets manifest to expire days from now. + --custom= Set custom JSON data for the target(s). +`) +} +func cmdDelegateAdd(args *docopt.Args, repo *tuf.Repo) error { + var custom json.RawMessage + if c := args.String["--custom"]; c != "" { + custom = json.RawMessage(c) + } + paths := args.All[""].([]string) + argv := args.String[""] + if arg := args.String["--expires"]; arg != "" { + expires, err := parseExpires(arg) + if err != nil { + return err + } + return repo.DelegateAddTargetsWithExpires(argv, paths, custom, expires) + } + return repo.DelegateAddTargets(argv, paths, custom) +} diff --git a/cmd/tuf/dele_gen_key.go b/cmd/tuf/dele_gen_key.go new file mode 100644 index 00000000..e56b4f49 --- /dev/null +++ b/cmd/tuf/dele_gen_key.go @@ -0,0 +1,46 @@ +package main + +import ( + "fmt" + + "github.com/flynn/go-docopt" + "github.com/theupdateframework/go-tuf" +) + +func init() { + register("dele-gen-key", cmdDeleGenKey, ` +usage: tuf dele-gen-key [--expires=] + +Generate a new signing key for the given role, name of the role is required. +Before gen-key, this role must be initialized by dele-init. + +The key will be serialized to JSON and written to the "keys" directory with +filename pattern "ROLE-KEYID.json". The root manifest will also be staged +with the addition of the key's ID to the role's list of key IDs. + +Options: + --expires= Set the root manifest to expire days from now. +`) +} + +func cmdDeleGenKey(args *docopt.Args, repo *tuf.Repo) error { + role := args.String[""] + var keyids []string + var err error + if arg := args.String["--expires"]; arg != "" { + expires, err := parseExpires(arg) + if err != nil { + return err + } + keyids, err = repo.DelegateGenKeyWithExpires(role, expires) + } else { + keyids, err = repo.DelegateGenKey(role) + } + if err != nil { + return err + } + for _, id := range keyids { + fmt.Println("Generated", role, "key with ID", id) + } + return nil +} diff --git a/cmd/tuf/dele_remove.go b/cmd/tuf/dele_remove.go new file mode 100644 index 00000000..85f76ea4 --- /dev/null +++ b/cmd/tuf/dele_remove.go @@ -0,0 +1,36 @@ +package main + +import ( + "errors" + + "github.com/flynn/go-docopt" + "github.com/theupdateframework/go-tuf" +) + +func init() { + register("dele-remove", cmdDelegationRemove, ` +usage: tuf dele-remove [--expires=] [--all] [...] + +Remove target file(s) from a delegated role + +Options: + --all Remove all target files. + --expires= Set the targets manifest to expire days from now. +`) +} + +func cmdDelegationRemove(args *docopt.Args, repo *tuf.Repo) error { + paths := args.All[""].([]string) + if len(paths) == 0 && !args.Bool["--all"] { + return errors.New("either specify some paths or set the --all flag to remove all targets") + } + argv := args.String[""] + if arg := args.String["--expires"]; arg != "" { + expires, err := parseExpires(arg) + if err != nil { + return err + } + return repo.DelegateRemoveTargetsWithExpires(argv, paths, expires) + } + return repo.DelegateRemoveTargets(argv, paths) +} diff --git a/cmd/tuf/dele_revoke.go b/cmd/tuf/dele_revoke.go new file mode 100644 index 00000000..66737ee4 --- /dev/null +++ b/cmd/tuf/dele_revoke.go @@ -0,0 +1,31 @@ +package main + +import ( + "github.com/flynn/go-docopt" + "github.com/theupdateframework/go-tuf" +) + +func init() { + register("dele-revoke", cmdDeleRevokeKey, ` +usage: tuf dele-revoke [--expires=] + +Revoke a signing key for delegated role + +The key will be removed from the top-target manifest, but the key will remain in the +"keys" directory if present. + +Options: + --expires= Set the root manifest to expire days from now. +`) +} + +func cmdDeleRevokeKey(args *docopt.Args, repo *tuf.Repo) error { + if arg := args.String["--expires"]; arg != "" { + expires, err := parseExpires(arg) + if err != nil { + return err + } + return repo.DelegateRevokeKeyWithExpires(args.String[""], args.String[""], expires) + } + return repo.DelegateRevokeKey(args.String[""], args.String[""]) +} diff --git a/cmd/tuf/target_keys.go b/cmd/tuf/target_keys.go new file mode 100644 index 00000000..5c2159a3 --- /dev/null +++ b/cmd/tuf/target_keys.go @@ -0,0 +1,27 @@ +package main + +import ( + "encoding/json" + "os" + + "github.com/flynn/go-docopt" + "github.com/theupdateframework/go-tuf" +) + +func init() { + register("target-keys", cmdTargKeys, ` +usage: tuf target-keys + +Outputs a JSON serialized array of targets keys to STDOUT. + +The resulting JSON should be distributed to clients for performing initial updates. +`) +} + +func cmdTargKeys(args *docopt.Args, repo *tuf.Repo) error { + keys, err := repo.RootKeys() + if err != nil { + return err + } + return json.NewEncoder(os.Stdout).Encode(keys) +} diff --git a/data/types.go b/data/types.go index 27519f54..df306041 100644 --- a/data/types.go +++ b/data/types.go @@ -112,6 +112,19 @@ func (r *Root) AddKey(key *Key) bool { return changed } +//TargetAddKey checks existence of a key, +//Add it to top Target's key filed if not exist +func (t *Targets) TargetAddKey(key *Key) bool { + changed := false + for _, id := range key.IDs() { + if _, ok := t.Keys[id]; !ok { + changed = true + t.Keys[id] = key + } + } + return changed +} + // UniqueKeys returns the unique keys for each associated role. // We might have multiple key IDs that correspond to the same key. func (r Root) UniqueKeys() map[string][]*Key { @@ -135,6 +148,28 @@ func (r Root) UniqueKeys() map[string][]*Key { return keysByRole } +//TargetUniqueKeys checks how many unique keys in top target role +func (t Targets) TargetUniqueKeys() map[string][]*Key { + keysByRole := make(map[string][]*Key) + for name, role := range t.Roles { + seen := make(map[string]struct{}) + keys := []*Key{} + for _, id := range role.KeyIDs { + // Double-check that there is actually a key with that ID. + if key, ok := t.Keys[id]; ok { + val := key.Value.Public.String() + if _, ok := seen[val]; ok { + continue + } + seen[val] = struct{}{} + keys = append(keys, key) + } + } + keysByRole[name] = keys + } + return keysByRole +} + type Role struct { KeyIDs []string `json:"keyids"` Threshold int `json:"threshold"` @@ -188,6 +223,7 @@ type Snapshot struct { Meta SnapshotFiles `json:"meta"` } +//NewSnapshot create a Snapshot with default values func NewSnapshot() *Snapshot { return &Snapshot{ Type: "snapshot", @@ -208,11 +244,13 @@ func (f TargetFileMeta) HashAlgorithms() []string { } type Targets struct { - Type string `json:"_type"` - SpecVersion string `json:"spec_version"` - Version int `json:"version"` - Expires time.Time `json:"expires"` - Targets TargetFiles `json:"targets"` + Type string `json:"_type"` + SpecVersion string `json:"spec_version"` + Version int `json:"version"` + Expires time.Time `json:"expires"` + Targets TargetFiles `json:"targets"` + Keys map[string]*Key `json:"keys"` + Roles map[string]*Role `json:"roles"` } func NewTargets() *Targets { @@ -221,6 +259,8 @@ func NewTargets() *Targets { SpecVersion: "1.0", Expires: DefaultExpires("targets"), Targets: make(TargetFiles), + Keys: make(map[string]*Key), + Roles: make(map[string]*Role), } } diff --git a/local_store.go b/local_store.go index f16c9da1..d92b6236 100644 --- a/local_store.go +++ b/local_store.go @@ -15,6 +15,8 @@ import ( "github.com/theupdateframework/go-tuf/util" ) +//MemoryStore constructs a memoryStore object with given meta and files, +//connected to repo.go as LocalStore declared as interface func MemoryStore(meta map[string]json.RawMessage, files map[string][]byte) LocalStore { if meta == nil { meta = make(map[string]json.RawMessage) @@ -34,6 +36,7 @@ type memoryStore struct { signers map[string][]sign.Signer } +//GetMeta reads all meta data from a memoryStore func (m *memoryStore) GetMeta() (map[string]json.RawMessage, error) { meta := make(map[string]json.RawMessage, len(m.meta)+len(m.stagedMeta)) for key, value := range m.meta { @@ -124,6 +127,11 @@ func (f *fileSystemStore) stagedDir() string { return filepath.Join(f.dir, "staged") } +func (f *fileSystemStore) keysDir() string { + return filepath.Join(f.dir, "keys") +} + +//GetMeta reads all .json data from local func (f *fileSystemStore) GetMeta() (map[string]json.RawMessage, error) { meta := make(map[string]json.RawMessage) var err error @@ -131,6 +139,26 @@ func (f *fileSystemStore) GetMeta() (map[string]json.RawMessage, error) { _, err := os.Stat(path) return os.IsNotExist(err) } + if !notExists(f.stagedDir()) { + dir, err := ioutil.ReadDir(f.keysDir()) + if err != nil { + return meta, err + } + //adding all delegated role names into top level manifests + //so that it can be initiated in the system + for _, fileInfo := range dir { + nameJSON := fileInfo.Name() + switch nameJSON { + case "root.json", "targets.json", "snapshot.json", "timestamp.json": + fallthrough + default: + if strings.HasSuffix(nameJSON, ".json") { + topLevelManifests = append(topLevelManifests, nameJSON) + } + } + } + } + for _, name := range topLevelManifests { path := filepath.Join(f.stagedDir(), name) if notExists(path) { diff --git a/repo.go b/repo.go index cc1a3167..02c50625 100644 --- a/repo.go +++ b/repo.go @@ -87,6 +87,8 @@ func NewRepoIndent(local LocalStore, prefix string, indent string, hashAlgorithm return r, nil } +//Init generates a new repository, +//check if some targets already existes func (r *Repo) Init(consistentSnapshot bool) error { t, err := r.targets() if err != nil { @@ -95,17 +97,27 @@ func (r *Repo) Init(consistentSnapshot bool) error { if len(t.Targets) > 0 { return ErrInitNotAllowed } + if len(t.Roles) > 0 { + return ErrInitNotAllowed + } root := data.NewRoot() root.ConsistentSnapshot = consistentSnapshot return r.setMeta("root.json", root) } +//db() creates a database: the root and top target roles +//are acquired, retrive their roles and keys, +//and add into the db,return the db object. func (r *Repo) db() (*verify.DB, error) { db := verify.NewDB() root, err := r.root() if err != nil { return nil, err } + target, err := r.targets() + if err != nil { + return nil, err + } for id, k := range root.Keys { if err := db.AddKey(id, k); err != nil { // TUF is considering in TAP-12 removing the @@ -124,9 +136,22 @@ func (r *Repo) db() (*verify.DB, error) { return nil, err } } + for id, k := range target.Keys { + if err := db.AddKey(id, k); err != nil { + return nil, err + } + } + for name, role := range target.Roles { + if err := db.AddRole(name, role); err != nil { + return nil, err + } + } return db, nil } +//root() is a getter for the root role, +//return Root object if already exists +//otherwise create a new Root object func (r *Repo) root() (*data.Root, error) { rootJSON, ok := r.meta["root.json"] if !ok { @@ -143,6 +168,9 @@ func (r *Repo) root() (*data.Root, error) { return root, nil } +//snapshot() is a getter for the snapshot role, +//return a Snapshot object if already exists +//otherwise create a new Snapshot object func (r *Repo) snapshot() (*data.Snapshot, error) { snapshotJSON, ok := r.meta["snapshot.json"] if !ok { @@ -159,6 +187,7 @@ func (r *Repo) snapshot() (*data.Snapshot, error) { return snapshot, nil } +//RootVersion is getter for version of Root role func (r *Repo) RootVersion() (int, error) { root, err := r.root() if err != nil { @@ -167,6 +196,7 @@ func (r *Repo) RootVersion() (int, error) { return root.Version, nil } +//Targets is getter for the targeted files func (r *Repo) Targets() (data.TargetFiles, error) { targets, err := r.targets() if err != nil { @@ -175,6 +205,7 @@ func (r *Repo) Targets() (data.TargetFiles, error) { return targets.Targets, nil } +//SetTargetsVersion is setter for version of top Target role func (r *Repo) SetTargetsVersion(v int) error { t, err := r.targets() if err != nil { @@ -184,6 +215,7 @@ func (r *Repo) SetTargetsVersion(v int) error { return r.setMeta("targets.json", t) } +//TargetsVersion is getter for version of top Target role func (r *Repo) TargetsVersion() (int, error) { t, err := r.targets() if err != nil { @@ -192,6 +224,7 @@ func (r *Repo) TargetsVersion() (int, error) { return t.Version, nil } +//SetTimestampVersion is a setter for the version of Timestamp role func (r *Repo) SetTimestampVersion(v int) error { ts, err := r.timestamp() if err != nil { @@ -202,6 +235,7 @@ func (r *Repo) SetTimestampVersion(v int) error { return r.setMeta("timestamp.json", ts) } +//TimestampVersion is a getter for the version of Timestamp role func (r *Repo) TimestampVersion() (int, error) { ts, err := r.timestamp() if err != nil { @@ -210,17 +244,18 @@ func (r *Repo) TimestampVersion() (int, error) { return ts.Version, nil } +//SetSnapshotVersion is a setter for the version of Snapshot role func (r *Repo) SetSnapshotVersion(v int) error { s, err := r.snapshot() if err != nil { return err } - s.Version = v r.versionUpdated["snapshot.json"] = struct{}{} return r.setMeta("snapshot.json", s) } +//SnapshotVersion is a getter for the version of Snapshot role func (r *Repo) SnapshotVersion() (int, error) { s, err := r.snapshot() if err != nil { @@ -229,6 +264,8 @@ func (r *Repo) SnapshotVersion() (int, error) { return s.Version, nil } +//targets is getter for top Target role if existed, +//otherwise return a new Target role. func (r *Repo) targets() (*data.Targets, error) { targetsJSON, ok := r.meta["targets.json"] if !ok { @@ -245,6 +282,8 @@ func (r *Repo) targets() (*data.Targets, error) { return targets, nil } +//timestamp is getter for Snapshot role if existed, +//otherwise return a new Snapshot role. func (r *Repo) timestamp() (*data.Timestamp, error) { timestampJSON, ok := r.meta["timestamp.json"] if !ok { @@ -261,10 +300,16 @@ func (r *Repo) timestamp() (*data.Timestamp, error) { return timestamp, nil } +//GenKey call the function to generate a key pair for a role +//with default expiration date of root, +//default value is stored in data.DefaultExpires func (r *Repo) GenKey(role string) ([]string, error) { return r.GenKeyWithExpires(role, data.DefaultExpires("root")) } +//GenKeyWithExpires generate a key pair, +//add the private part to root role metadata, +//return the public key's ID func (r *Repo) GenKeyWithExpires(keyRole string, expires time.Time) ([]string, error) { key, err := sign.GenerateEd25519Key() if err != nil { @@ -278,10 +323,14 @@ func (r *Repo) GenKeyWithExpires(keyRole string, expires time.Time) ([]string, e return key.PublicData().IDs(), nil } +//AddPrivateKey will call AddPrivateKeyWithExpires() with expiration added func (r *Repo) AddPrivateKey(role string, key *sign.PrivateKey) error { return r.AddPrivateKeyWithExpires(role, key, data.DefaultExpires(role)) } +//AddPrivateKeyWithExpires will first verify the role and expiration, +//save the private part to local storage, +//format public part and add into Root role func (r *Repo) AddPrivateKeyWithExpires(keyRole string, key *sign.PrivateKey, expires time.Time) error { root, err := r.root() if err != nil { @@ -328,10 +377,13 @@ func (r *Repo) AddPrivateKeyWithExpires(keyRole string, key *sign.PrivateKey, ex return r.setMeta("root.json", root) } +//validExpires examine the expiration date is valid, +//only if the expiration date is in the future func validExpires(expires time.Time) bool { return expires.Sub(time.Now()) > 0 } +//RootKeys return all Key objects in root metadata func (r *Repo) RootKeys() ([]*data.Key, error) { root, err := r.root() if err != nil { @@ -366,10 +418,47 @@ func (r *Repo) RootKeys() ([]*data.Key, error) { return rootKeys, nil } +//TargetKeys return Key objects in Top Target metadata +//similar as RootKeys(), as top Target will contain delegated target roles +func (r *Repo) TargetKeys() ([]*data.Key, error) { + root, err := r.root() + if err != nil { + return nil, err + } + role, ok := root.Roles["targets"] + if !ok { + return nil, nil + } + seen := make(map[string]struct{}) + targetKeys := []*data.Key{} + for _, id := range role.KeyIDs { + key, ok := root.Keys[id] + if !ok { + return nil, fmt.Errorf("tuf: invalid top target metadata") + } + found := false + if _, ok := seen[id]; ok { + found = true + break + } + if !found { + for _, id := range key.IDs() { + seen[id] = struct{}{} + } + targetKeys = append(targetKeys, key) + } + } + return targetKeys, nil +} + +//RevokeKey will call RevokeKeyWithExpires +//add the default expiration time of root default func (r *Repo) RevokeKey(role, id string) error { return r.RevokeKeyWithExpires(role, id, data.DefaultExpires("root")) } +//RevokeKeyWithExpires will remove all matched keys from Root, +//and update Root's expiration & version func (r *Repo) RevokeKeyWithExpires(keyRole, id string, expires time.Time) error { if !verify.ValidRole(keyRole) { return ErrInvalidRole{keyRole} @@ -440,6 +529,9 @@ func (r *Repo) jsonMarshal(v interface{}) ([]byte, error) { return out.Bytes(), nil } +//setMeta will retrive the keys of this role, +//format the data as a json marshal, +//then storage to the local storage func (r *Repo) setMeta(name string, meta interface{}) error { keys, err := r.getSigningKeys(strings.TrimSuffix(name, ".json")) if err != nil { @@ -457,6 +549,9 @@ func (r *Repo) setMeta(name string, meta interface{}) error { return r.local.SetMeta(name, b) } +//Sign will get the metadata of a role, +//verify the keys, sign it, +//then write to the local. func (r *Repo) Sign(name string) error { role := strings.TrimSuffix(name, ".json") if !verify.ValidRole(role) { @@ -535,8 +630,8 @@ func (r *Repo) signedMeta(name string) (*data.Signed, error) { return s, nil } -func validManifest(name string) bool { - for _, m := range topLevelManifests { +func validSnapManifest(name string) bool { + for _, m := range snapshotManifests { if m == name { return true } @@ -544,6 +639,8 @@ func validManifest(name string) bool { return false } +//AddTarget and followed three is a set of functions adding targets, +//first two add default expiration parameters func (r *Repo) AddTarget(path string, custom json.RawMessage) error { return r.AddTargets([]string{path}, custom) } @@ -556,6 +653,11 @@ func (r *Repo) AddTargetWithExpires(path string, custom json.RawMessage, expires return r.AddTargetsWithExpires([]string{path}, custom, expires) } +//AddTargetsWithExpires first examine expiration, normalize the paths of targeted files, +//all targeted files should be in the directory "staged" +//walk through these files in dir"staged", check them exist, +//put metadata of the targeted file into top Target role, +//update top Target version func (r *Repo) AddTargetsWithExpires(paths []string, custom json.RawMessage, expires time.Time) error { if !validExpires(expires) { return ErrInvalidExpires{expires} @@ -599,6 +701,8 @@ func (r *Repo) AddTargetsWithExpires(paths []string, custom json.RawMessage, exp return r.setMeta("targets.json", t) } +//The following four is a set of functions removing targets, +//first two add default expiration parameters func (r *Repo) RemoveTarget(path string) error { return r.RemoveTargets([]string{path}) } @@ -647,10 +751,14 @@ func (r *Repo) RemoveTargetsWithExpires(paths []string, expires time.Time) error return r.setMeta("targets.json", t) } +//Snapshot call next function with default expiration date func (r *Repo) Snapshot(t CompressionType) error { return r.SnapshotWithExpires(t, data.DefaultExpires("snapshot")) } +//SnapshotWithExpires creates snapshot object and database for use, +//expands snapshotManifests to include delegated target roles, +//verify each of its signatures and update version func (r *Repo) SnapshotWithExpires(t CompressionType, expires time.Time) error { if !validExpires(expires) { return ErrInvalidExpires{expires} @@ -664,6 +772,17 @@ func (r *Repo) SnapshotWithExpires(t CompressionType, expires time.Time) error { if err != nil { return err } + + //Expand snapshotManifest to include delegated roles + targ, err := r.targets() + if err != nil { + return err + } + + for name := range targ.Roles { + snapshotManifests = append(snapshotManifests, name+".json") + } + // TODO: generate compressed manifests for _, name := range snapshotManifests { if err := r.verifySignature(name, db); err != nil { @@ -683,10 +802,12 @@ func (r *Repo) SnapshotWithExpires(t CompressionType, expires time.Time) error { return r.setMeta("snapshot.json", snapshot) } +//Timestamp call next function with default expiration date func (r *Repo) Timestamp() error { return r.TimestampWithExpires(data.DefaultExpires("timestamp")) } +//TimestampWithExpires verifies snapshot, and update its own version func (r *Repo) TimestampWithExpires(expires time.Time) error { if !validExpires(expires) { return ErrInvalidExpires{expires} @@ -715,6 +836,7 @@ func (r *Repo) TimestampWithExpires(expires time.Time) error { return r.setMeta("timestamp.json", timestamp) } +//fileVersions() acquires all role versions except Timestamp func (r *Repo) fileVersions() (map[string]int, error) { root, err := r.root() if err != nil { @@ -732,11 +854,26 @@ func (r *Repo) fileVersions() (map[string]int, error) { versions["root.json"] = root.Version versions["targets.json"] = targets.Version versions["snapshot.json"] = snapshot.Version + + //delegated target roles shall also being put in versions + for tar := range targets.Roles { + temp, err := r.delegationTargets(tar + ".json") + if err != nil { + return nil, err + } + versions[tar+".json"] = temp.Version + } return versions, nil } +//fileHashes() obtains Hashes component from +//all roles, include all delegated roles. func (r *Repo) fileHashes() (map[string]data.Hashes, error) { hashes := make(map[string]data.Hashes) + target, err := r.targets() + if err != nil { + return nil, err + } timestamp, err := r.timestamp() if err != nil { return nil, err @@ -751,6 +888,11 @@ func (r *Repo) fileHashes() (map[string]data.Hashes, error) { if m, ok := snapshot.Meta["targets.json"]; ok { hashes["targets.json"] = m.Hashes } + for tar := range target.Roles { + if m, ok := snapshot.Meta[tar+".json"]; ok { + hashes[tar+".json"] = m.Hashes + } + } if m, ok := timestamp.Meta["snapshot.json"]; ok { hashes["snapshot.json"] = m.Hashes } @@ -761,28 +903,57 @@ func (r *Repo) fileHashes() (map[string]data.Hashes, error) { for name, meta := range t.Targets { hashes[path.Join("targets", name)] = meta.Hashes } + for tar := range target.Roles { + temp, err := r.delegationTargets(tar + ".json") + if err != nil { + return nil, err + } + for name, meta := range temp.Targets { + hashes[path.Join("targets", name)] = meta.Hashes + } + } return hashes, nil } +//Commit will do all verifications, include: +//all roles and delegated roles are valid, +//not missing any metadata, +//verify snapshot and timestamp are updated, +//verify all signatures, +//after all these call local Commit, +//which will move the targeted files under /staged to /repo. func (r *Repo) Commit() error { - // check we have all the metadata - for _, name := range topLevelManifests { - if _, ok := r.meta[name]; !ok { - return ErrMissingMetadata{name} - } - } - // check roles are valid root, err := r.root() if err != nil { return err } + + // check roles in root are valid for name, role := range root.Roles { if len(role.KeyIDs) < role.Threshold { return ErrNotEnoughKeys{name, len(role.KeyIDs), role.Threshold} } } + // check delegated target roles are valid + target, err := r.targets() + if err != nil { + return err + } + for name, role := range target.Roles { + if len(role.KeyIDs) < role.Threshold { + return ErrNotEnoughKeys{name, len(role.KeyIDs), role.Threshold} + } + } + + // check we have all the metadata + for _, name := range topLevelManifests { + if _, ok := r.meta[name]; !ok { + return ErrMissingMetadata{name} + } + } + // verify hashes in snapshot.json are up to date snapshot, err := r.snapshot() if err != nil { @@ -877,3 +1048,315 @@ func (r *Repo) timestampFileMeta(name string) (data.TimestampFileMeta, error) { } return util.GenerateTimestampFileMeta(bytes.NewReader(b), r.hashAlgorithms...) } + +//delegationTargets is a getter for those delegation target roles +//Used for delegation only, create new target when not exist +//Name entry here should in format "roleName.json" +func (r *Repo) delegationTargets(nameJSON string) (*data.Targets, error) { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + targetsJSON, ok := r.meta[nameJSON] + if !ok { + return data.NewTargets(), nil + } + s := &data.Signed{} + if err := json.Unmarshal(targetsJSON, s); err != nil { + return nil, err + } + targets := &data.Targets{} + if err := json.Unmarshal(s.Signed, targets); err != nil { + return nil, err + } + return targets, nil +} + +// DelegateTargetVersion is a getter for a non-top target roles' meta +func (r *Repo) DelegateTargetVersion(nameJSON string) (int, error) { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + d, err := r.delegationTargets(nameJSON) + if err != nil { + return -1, err + } + return d.Version, nil +} + +//SetDelegateTargetVersion is a setter of version +//for non-top target meta +func (r *Repo) SetDelegateTargetVersion(nameJSON string, v int) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + d, err := r.delegationTargets(nameJSON) + if err != nil { + return err + } + d.Version = v + return r.setMeta(nameJSON, d) +} + +//DelegateGenKey invokes DelegateGenKeyWithExpires with default expire time +func (r *Repo) DelegateGenKey(role string) ([]string, error) { + return r.DelegateGenKeyWithExpires(role, data.DefaultExpires("targets")) +} + +//DelegateGenKeyWithExpires generate a new key pair, +//invoke addkey and returns ID of new key +func (r *Repo) DelegateGenKeyWithExpires(keyRole string, expires time.Time) ([]string, error) { + key, err := sign.GenerateEd25519Key() + if err != nil { + return []string{}, err + } + + if err = r.DelegateAddPrivateKeyWithExpires(keyRole, key, expires); err != nil { + return []string{}, err + } + + return key.PublicData().IDs(), nil +} + +//DelegateAddPrivateKey add a single private key +func (r *Repo) DelegateAddPrivateKey(role string, key *sign.PrivateKey) error { + return r.DelegateAddPrivateKeyWithExpires(role, key, data.DefaultExpires(role)) +} + +//DelegateAddPrivateKeyWithExpires save new key to local, +//Add new role information and key info, +//Update the top targets.json +func (r *Repo) DelegateAddPrivateKeyWithExpires(nameJSON string, key *sign.PrivateKey, expires time.Time) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + name := strings.TrimSuffix(nameJSON, ".json") + + target, err := r.targets() + if err != nil { + return err + } + + if !validExpires(expires) { + return ErrInvalidExpires{expires} + } + + if err := r.local.SavePrivateKey(name, key); err != nil { + return err + } + pk := key.PublicData() + + role, ok := target.Roles[name] + if !ok { + role = &data.Role{KeyIDs: []string{}, Threshold: 1} + target.Roles[name] = role + } + + changed := false + if role.AddKeyIDs(pk.IDs()) { + changed = true + } + + if target.TargetAddKey(pk) { + changed = true + } + + if !changed { + return nil + } + + target.Expires = expires.Round(time.Second) + if _, ok := r.versionUpdated["targets.json"]; !ok { + target.Version++ + r.versionUpdated["targets.json"] = struct{}{} + } + + return r.setMeta("targets.json", target) +} + +//DelegateRevokeKey revoke a key for a certain delegated role +func (r *Repo) DelegateRevokeKey(role, id string) error { + return r.DelegateRevokeKeyWithExpires(role, id, data.DefaultExpires("targets")) +} + +//DelegateRevokeKeyWithExpires revoke a key with new expire set +func (r *Repo) DelegateRevokeKeyWithExpires(keyRole, id string, expires time.Time) error { + + if !validExpires(expires) { + return ErrInvalidExpires{expires} + } + + targ, err := r.targets() + if err != nil { + return err + } + + key, ok := targ.Keys[id] + if !ok { + return ErrKeyNotFound{keyRole, id} + } + + role, ok := targ.Roles[keyRole] + if !ok { + return ErrKeyNotFound{keyRole, id} + } + + keyIDs := make([]string, 0, len(role.KeyIDs)) + + // There may be multiple keyids that correspond to this key, so + // filter all of them out. + for _, keyID := range role.KeyIDs { + if key.ContainsID(keyID) { + continue + } + keyIDs = append(keyIDs, keyID) + } + if len(keyIDs) == len(role.KeyIDs) { + return ErrKeyNotFound{keyRole, id} + } + role.KeyIDs = keyIDs + + for _, keyID := range key.IDs() { + delete(targ.Keys, keyID) + } + targ.Roles[keyRole] = role + targ.Expires = expires.Round(time.Second) + if _, ok := r.versionUpdated["targets.json"]; !ok { + targ.Version++ + r.versionUpdated["targets.json"] = struct{}{} + } + + return r.setMeta("targets.json", targ) +} + +//DelegateAddTarget add a target to non-top target role +func (r *Repo) DelegateAddTarget(nameJSON, path string, custom json.RawMessage) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateAddTargets(nameJSON, []string{path}, custom) +} + +//DelegateAddTargets add targets to non-top target role +func (r *Repo) DelegateAddTargets(nameJSON string, paths []string, custom json.RawMessage) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateAddTargetsWithExpires(nameJSON, paths, custom, data.DefaultExpires("targets")) +} + +//DelegateAddTargetWithExpires adds single target to non-top target role +func (r *Repo) DelegateAddTargetWithExpires(nameJSON string, path string, custom json.RawMessage, expires time.Time) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateAddTargetsWithExpires(nameJSON, []string{path}, custom, expires) +} + +//DelegateAddTargetsWithExpires add targets to non-top target role with expire date +func (r *Repo) DelegateAddTargetsWithExpires(nameJSON string, paths []string, custom json.RawMessage, expires time.Time) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + if !validExpires(expires) { + return ErrInvalidExpires{expires} + } + d, err := r.delegationTargets(nameJSON) + if err != nil { + return err + } + normalizedPaths := make([]string, len(paths)) + for i, path := range paths { + normalizedPaths[i] = util.NormalizeTarget(path) + } + + if err := r.local.WalkStagedTargets(normalizedPaths, func(path string, target io.Reader) (err error) { + meta, err := util.GenerateTargetFileMeta(target, r.hashAlgorithms...) + if err != nil { + return err + } + path = util.NormalizeTarget(path) + + // if we have custom metadata, set it, otherwise maintain + // existing metadata if present + if len(custom) > 0 { + meta.Custom = &custom + } else if d, ok := d.Targets[path]; ok { + meta.Custom = d.Custom + } + + delete(d.Targets, "/"+path) + d.Targets[path] = meta + return nil + }); err != nil { + return err + } + d.Expires = expires.Round(time.Second) + if _, ok := r.versionUpdated[nameJSON]; !ok { + d.Version++ + r.versionUpdated[nameJSON] = struct{}{} + } + return r.setMeta(nameJSON, d) +} + +//DelegateRemoveTarget remove target for non-top target role +func (r *Repo) DelegateRemoveTarget(nameJSON, path string) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateRemoveTargets(nameJSON, []string{path}) +} + +//DelegateRemoveTargets remove targets for non-top target role +func (r *Repo) DelegateRemoveTargets(nameJSON string, paths []string) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateRemoveTargetsWithExpires(nameJSON, paths, data.DefaultExpires("targets")) +} + +//DelegateRemoveTargetWithExpires calls the next function +func (r *Repo) DelegateRemoveTargetWithExpires(nameJSON string, path string, expires time.Time) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + return r.DelegateRemoveTargetsWithExpires(nameJSON, []string{path}, expires) +} + +// DelegateRemoveTargetsWithExpires remove +// If paths is empty, all targets will be removed +func (r *Repo) DelegateRemoveTargetsWithExpires(nameJSON string, paths []string, expires time.Time) error { + if !strings.Contains(nameJSON, ".json") { + nameJSON = nameJSON + ".json" + } + if !validExpires(expires) { + return ErrInvalidExpires{expires} + } + d, err := r.delegationTargets(nameJSON) + if err != nil { + return err + } + if len(paths) == 0 { + d.Targets = make(data.TargetFiles) + } else { + removed := false + for _, path := range paths { + path = util.NormalizeTarget(path) + if _, ok := d.Targets[path]; !ok { + continue + } + removed = true + // G2 -> we no longer desire any readers to ever observe non-prefix targets. + delete(d.Targets, "/"+path) + delete(d.Targets, path) + } + if !removed { + return nil + } + } + d.Expires = expires.Round(time.Second) + if _, ok := r.versionUpdated[nameJSON]; !ok { + d.Version++ + r.versionUpdated[nameJSON] = struct{}{} + } + return r.setMeta(nameJSON, d) +} diff --git a/repo_test.go b/repo_test.go index 8e284629..fd403e7b 100644 --- a/repo_test.go +++ b/repo_test.go @@ -41,6 +41,11 @@ func (*RepoSuite) assertNumUniqueKeys(c *C, root *data.Root, role string, num in c.Assert(root.UniqueKeys()[role], HasLen, num) } +//Same function as previous one just for top Target role +func (*RepoSuite) targetAssertUniqueKeys(c *C, targ *data.Targets, role string, num int) { + c.Assert(targ.TargetUniqueKeys()[role], HasLen, num) +} + func testNewRepo(c *C, newRepo func(local LocalStore, hashAlgorithms ...string) (*Repo, error)) { meta := map[string]json.RawMessage{ "root.json": []byte(`{ @@ -57,8 +62,11 @@ func testNewRepo(c *C, newRepo func(local LocalStore, hashAlgorithms ...string) "signed": { "_type": "targets", "version": 1, - "expires": "2015-03-26T03:26:55.82155686Z", - "targets": {} + "expires": "2015-03-26T03:26:55.82155686Z", + "keys":{}, + "targets": {}, + "roles": {}, + "delegations":{} }, "signatures": [] }`), @@ -98,6 +106,8 @@ func testNewRepo(c *C, newRepo func(local LocalStore, hashAlgorithms ...string) c.Assert(targets.Version, Equals, 1) c.Assert(targets.Targets, NotNil) c.Assert(targets.Targets, HasLen, 0) + c.Assert(targets.Targets, HasLen, 0) + c.Assert(targets.Keys, HasLen, 0) snapshot, err := r.snapshot() c.Assert(err, IsNil) @@ -142,6 +152,15 @@ func genKey(c *C, r *Repo, role string) []string { return keyids } +//Generate a key for a certain delegated role +//default tests are contained +func delegateGenKey(c *C, r *Repo, roleName string) []string { + keyids, err := r.DelegateGenKey(roleName) + c.Assert(err, IsNil) + c.Assert(len(keyids) > 0, Equals, true) + return keyids +} + func (rs *RepoSuite) TestGenKey(c *C) { local := MemoryStore(make(map[string]json.RawMessage), nil) r, err := NewRepo(local) @@ -477,6 +496,8 @@ func (rs *RepoSuite) TestRevokeKey(c *C) { genKey(c, r, "root") target1IDs := genKey(c, r, "targets") target2IDs := genKey(c, r, "targets") + delek1 := delegateGenKey(c, r, "role01") + delek2 := delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") root, err := r.root() @@ -489,7 +510,13 @@ func (rs *RepoSuite) TestRevokeKey(c *C) { rs.assertNumUniqueKeys(c, root, "snapshot", 1) rs.assertNumUniqueKeys(c, root, "timestamp", 1) - // revoke a key + target, err := r.targets() + c.Assert(err, IsNil) + c.Assert(target.Roles, HasLen, 1) + c.Assert(target.Keys, NotNil) + rs.targetAssertUniqueKeys(c, target, "role01", 2) + + // revoke a key of top Target role targetsRole, ok := root.Roles["targets"] if !ok { c.Fatal("missing targets role") @@ -503,6 +530,18 @@ func (rs *RepoSuite) TestRevokeKey(c *C) { c.Assert(r.RevokeKey("targets", id), DeepEquals, ErrKeyNotFound{"targets", id}) } + //Revoke a Key for the delegated role + tempRole, ok := target.Roles["role01"] + if !ok { + c.Fatal("missing targets role") + } + c.Assert(tempRole.KeyIDs, HasLen, len(delek1)+len(delek2)) + id2 := tempRole.KeyIDs[0] + c.Assert(r.DelegateRevokeKey("role01", id2), IsNil) + for _, id := range delek1 { + c.Assert(r.RevokeKey("role01", id), DeepEquals, ErrInvalidRole{Role: "role01"}) + } + // check root was updated root, err = r.root() c.Assert(err, IsNil) @@ -519,6 +558,21 @@ func (rs *RepoSuite) TestRevokeKey(c *C) { } c.Assert(targetsRole.KeyIDs, HasLen, 1) c.Assert(targetsRole.KeyIDs, DeepEquals, target2IDs) + + // check target is updated + target, err = r.targets() + c.Assert(err, IsNil) + c.Assert(target.Roles, NotNil) + c.Assert(target.Roles, HasLen, 1) + c.Assert(target.Keys, NotNil) + rs.targetAssertUniqueKeys(c, target, "role01", 1) + + tempRole, ok = target.Roles["role01"] + if !ok { + c.Fatal("missing delegated targets role") + } + c.Assert(tempRole.KeyIDs, HasLen, 1) + c.Assert(tempRole.KeyIDs, DeepEquals, delek2) } func (rs *RepoSuite) TestSign(c *C) { @@ -564,8 +618,168 @@ func (rs *RepoSuite) TestSign(c *C) { checkSigIDs(append(key.PublicData().IDs(), newKey.PublicData().IDs()...)...) } +func (rs *RepoSuite) TestDelegation(c *C) { + files := map[string][]byte{"foo.txt": []byte("foo"), "bar.txt": []byte("ear"), "dar.txt": []byte("ear")} + local := MemoryStore(make(map[string]json.RawMessage), files) + r, err := NewRepo(local) + c.Assert(err, IsNil) + + //generate root and target + genKey(c, r, "root") + ids1 := genKey(c, r, "targets") + + c.Assert(r.AddTarget("foo.txt", nil), IsNil) + + //initialize new target toles + keyids, err := r.DelegateGenKey("role01") + c.Assert(err, IsNil) + c.Assert(len(keyids) > 0, Equals, true) + + //basic test root and target + root, err := r.root() + c.Assert(err, IsNil) + c.Assert(root.Roles, NotNil) + c.Assert(root.Roles, HasLen, 2) + rs.assertNumUniqueKeys(c, root, "root", 1) + target, err := r.targets() + c.Assert(err, IsNil) + c.Assert(target.Roles, NotNil) + c.Assert(target.Roles, HasLen, 1) + rs.assertNumUniqueKeys(c, root, "targets", 1) + + //check top target stores keys of delegated target role + targetRole, ok := root.Roles["targets"] + if !ok { + c.Fatal("missing target role") + } + c.Assert(targetRole.KeyIDs, HasLen, 1) + c.Assert(targetRole.KeyIDs, DeepEquals, ids1) + for _, keyID := range ids1 { + k, ok := root.Keys[keyID] + if !ok { + c.Fatal("missing key") + } + c.Assert(k.IDs(), DeepEquals, ids1) + c.Assert(k.Value.Public, HasLen, ed25519.PublicKeySize) + } + + //Check add target file function of delegation + c.Assert(r.DelegateAddTarget("role01.json", "foo.txt", nil), IsNil) + tempRole, ok := target.Roles["role01"] + if !ok { + c.Fatal("missing target role") + } + c.Assert(tempRole.KeyIDs, HasLen, 1) + c.Assert(tempRole.KeyIDs, DeepEquals, keyids) + for _, keyID := range keyids { + k, ok := target.Keys[keyID] + if !ok { + c.Fatal("missing key") + } + c.Assert(k.IDs(), DeepEquals, keyids) + c.Assert(k.Value.Public, HasLen, ed25519.PublicKeySize) + } + + //check non-top target role in db + db, err := r.db() + c.Assert(err, IsNil) + tempKeyIDs := make(map[string]struct{}, 2) + for _, id := range tempRole.KeyIDs { + tempKeyIDs[id] = struct{}{} + _, ok = target.Keys[id] + if !ok { + c.Fatal("missing key") + } + key := db.GetKey(id) + c.Assert(key, NotNil) + c.Assert(key.ContainsID(id), Equals, true) + } + role := db.GetRole("role01") + c.Assert(role.KeyIDs, DeepEquals, tempKeyIDs) + + // check the keys were saved correctly + localKeys, err := local.GetSigningKeys("role01") + c.Assert(err, IsNil) + c.Assert(localKeys, HasLen, 1) + for _, key := range localKeys { + found := false + for _, id := range tempRole.KeyIDs { + if key.ContainsID(id) { + found = true + break + } + } + if !found { + c.Fatal("missing key") + } + } + + // check target.json got staged + meta, err := local.GetMeta() + c.Assert(err, IsNil) + tarJSON, ok := meta["targets.json"] + if !ok { + c.Fatal("missing root metadata") + } + s := &data.Signed{} + c.Assert(json.Unmarshal(tarJSON, s), IsNil) + stagedTarget := &data.Targets{} + c.Assert(json.Unmarshal(s.Signed, stagedTarget), IsNil) + c.Assert(stagedTarget.Type, Equals, target.Type) + c.Assert(stagedTarget.Version, Equals, target.Version) + c.Assert(stagedTarget.Expires.UnixNano(), Equals, target.Expires.UnixNano()) + + //check role01.json got staged + tempTarget, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) + tempJSON, ok := meta["role01.json"] + if !ok { + c.Fatal("missing root metadata") + } + s1 := &data.Signed{} + c.Assert(json.Unmarshal(tempJSON, s1), IsNil) + stagedTempTarget := &data.Targets{} + c.Assert(json.Unmarshal(s1.Signed, stagedTempTarget), IsNil) + c.Assert(stagedTempTarget.Type, Equals, tempTarget.Type) + c.Assert(stagedTempTarget.Version, Equals, tempTarget.Version) + c.Assert(stagedTempTarget.Expires.UnixNano(), Equals, tempTarget.Expires.UnixNano()) + + // make sure both top-target and staged top-target have evaluated IDs(), otherwise + // DeepEquals will fail because those values might not have been + // computed yet. + for _, key := range target.Keys { + key.IDs() + } + for _, key := range stagedTarget.Keys { + key.IDs() + } + c.Assert(stagedTarget.Keys, DeepEquals, target.Keys) + c.Assert(stagedTarget.Roles, DeepEquals, target.Roles) + + // make sure both top-target and staged top-target have evaluated IDs(), otherwise + // DeepEquals will fail because those values might not have been + // computed yet. + for _, key := range tempTarget.Keys { + key.IDs() + } + for _, key := range stagedTempTarget.Keys { + key.IDs() + } + c.Assert(stagedTempTarget.Keys, DeepEquals, tempTarget.Keys) + c.Assert(stagedTempTarget.Roles, DeepEquals, tempTarget.Roles) + + // commit to make sure we don't modify metadata after committing metadata. + addGeneratedPrivateKey(c, r, "snapshot") + addGeneratedPrivateKey(c, r, "timestamp") + c.Assert(r.AddTargets([]string{}, nil), IsNil) + c.Assert(r.Snapshot(CompressionTypeNone), IsNil) + c.Assert(r.Timestamp(), IsNil) + c.Assert(r.Commit(), IsNil) +} + func (rs *RepoSuite) TestCommit(c *C) { - files := map[string][]byte{"foo.txt": []byte("foo"), "bar.txt": []byte("bar")} + files := map[string][]byte{ + "foo.txt": []byte("foo"), "bar.txt": []byte("bar"), "ear.txt": []byte("ear")} local := MemoryStore(make(map[string]json.RawMessage), files) r, err := NewRepo(local) c.Assert(err, IsNil) @@ -577,9 +791,16 @@ func (rs *RepoSuite) TestCommit(c *C) { genKey(c, r, "root") c.Assert(r.Commit(), DeepEquals, ErrMissingMetadata{"targets.json"}) + //Add non-top target role + keyids, err := r.DelegateGenKey("role01") + c.Assert(err, IsNil) + c.Assert(len(keyids) > 0, Equals, true) + c.Assert(r.Commit(), DeepEquals, ErrMissingMetadata{"snapshot.json"}) + // commit without snapshot.json genKey(c, r, "targets") c.Assert(r.AddTarget("foo.txt", nil), IsNil) + c.Assert(r.DelegateAddTarget("role01.json", "bar.txt", nil), IsNil) c.Assert(r.Commit(), DeepEquals, ErrMissingMetadata{"snapshot.json"}) // commit without timestamp.json @@ -602,10 +823,16 @@ func (rs *RepoSuite) TestCommit(c *C) { c.Assert(r.Sign("targets.json"), IsNil) c.Assert(r.Commit(), DeepEquals, errors.New("tuf: invalid root.json in snapshot.json: wrong length, expected 1740 got 2046")) + // commit with an invalid root hash in snapshot.json due to new key creation (non-top target) + keyids2, err := r.DelegateGenKey("role01") + c.Assert(err, IsNil) + c.Assert(len(keyids2) > 0, Equals, true) + c.Assert(r.Commit(), DeepEquals, errors.New("tuf: invalid root.json in snapshot.json: wrong length, expected 1740 got 2046")) + // commit with an invalid targets hash in snapshot.json c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.AddTarget("bar.txt", nil), IsNil) - c.Assert(r.Commit(), DeepEquals, errors.New("tuf: invalid targets.json in snapshot.json: wrong length, expected 725 got 899")) + c.Assert(r.Commit(), DeepEquals, errors.New("tuf: invalid targets.json in snapshot.json: wrong length, expected 1392 got 1566")) // commit with an invalid timestamp c.Assert(r.Snapshot(CompressionTypeNone), IsNil) @@ -632,7 +859,7 @@ func (rs *RepoSuite) TestCommit(c *C) { } func (rs *RepoSuite) TestCommitVersions(c *C) { - files := map[string][]byte{"foo.txt": []byte("foo")} + files := map[string][]byte{"foo.txt": []byte("foo"), "bar.txt": []byte("bar")} local := MemoryStore(make(map[string]json.RawMessage), files) r, err := NewRepo(local) c.Assert(err, IsNil) @@ -641,8 +868,10 @@ func (rs *RepoSuite) TestCommitVersions(c *C) { genKey(c, r, "targets") genKey(c, r, "snapshot") genKey(c, r, "timestamp") + delegateGenKey(c, r, "role01") c.Assert(r.AddTarget("foo.txt", nil), IsNil) + c.Assert(r.DelegateAddTarget("role01.json", "bar.txt", nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) @@ -656,6 +885,10 @@ func (rs *RepoSuite) TestCommitVersions(c *C) { c.Assert(err, IsNil) c.Assert(targetsVersion, Equals, 1) + delegateVersion, err := r.DelegateTargetVersion("role01.json") + c.Assert(err, IsNil) + c.Assert(delegateVersion, Equals, 1) + snapshotVersion, err := r.SnapshotVersion() c.Assert(err, IsNil) c.Assert(snapshotVersion, Equals, 1) @@ -677,6 +910,10 @@ func (rs *RepoSuite) TestCommitVersions(c *C) { c.Assert(err, IsNil) c.Assert(targetsVersion, Equals, 1) + delegateVersion, err = r.DelegateTargetVersion("role01.json") + c.Assert(err, IsNil) + c.Assert(delegateVersion, Equals, 1) + snapshotVersion, err = r.SnapshotVersion() c.Assert(err, IsNil) c.Assert(snapshotVersion, Equals, 2) @@ -708,6 +945,29 @@ func (rs *RepoSuite) TestCommitVersions(c *C) { timestampVersion, err = r.SnapshotVersion() c.Assert(err, IsNil) c.Assert(timestampVersion, Equals, 3) + + //adding extra keys for non-top target role + //should increase top-target version by 1 + delegateGenKey(c, r, "role01") + c.Assert(r.Snapshot(CompressionTypeNone), IsNil) + c.Assert(r.Timestamp(), IsNil) + c.Assert(r.Commit(), IsNil) + + rootVersion, err = r.RootVersion() + c.Assert(err, IsNil) + c.Assert(rootVersion, Equals, 2) + + targetsVersion, err = r.TargetsVersion() + c.Assert(err, IsNil) + c.Assert(targetsVersion, Equals, 2) + + snapshotVersion, err = r.SnapshotVersion() + c.Assert(err, IsNil) + c.Assert(snapshotVersion, Equals, 4) + + timestampVersion, err = r.SnapshotVersion() + c.Assert(err, IsNil) + c.Assert(timestampVersion, Equals, 4) } type tmpDir struct { @@ -806,6 +1066,7 @@ func (rs *RepoSuite) TestCommitFileSystem(c *C) { // generating keys should stage root.json and create repo dirs genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") tmp.assertExists("staged/root.json") @@ -831,6 +1092,18 @@ func (rs *RepoSuite) TestCommitFileSystem(c *C) { c.Fatal("missing target file: foo.txt") } + //adding a file stages non-top target + tmp.writeStagedTarget("ear.txt", "ear") + c.Assert(r.DelegateAddTarget("role01.json", "ear.txt", nil), IsNil) + tmp.assertExists("staged/role01.json") + tmp.assertEmpty("repository") + d, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) + c.Assert(d.Targets, HasLen, 1) + if _, ok := d.Targets["ear.txt"]; !ok { + c.Fatal("missing target file: ear.txt") + } + // Snapshot() stages snapshot.json c.Assert(r.Snapshot(CompressionTypeNone), IsNil) tmp.assertExists("staged/snapshot.json") @@ -845,9 +1118,11 @@ func (rs *RepoSuite) TestCommitFileSystem(c *C) { c.Assert(r.Commit(), IsNil) tmp.assertExists("repository/root.json") tmp.assertExists("repository/targets.json") + tmp.assertExists("repository/role01.json") tmp.assertExists("repository/snapshot.json") tmp.assertExists("repository/timestamp.json") tmp.assertFileContent("repository/targets/foo.txt", "foo") + tmp.assertFileContent("repository/targets/ear.txt", "ear") tmp.assertEmpty("staged/targets") tmp.assertEmpty("staged") @@ -873,6 +1148,17 @@ func (rs *RepoSuite) TestCommitFileSystem(c *C) { tmp.assertFileContent("repository/targets/path/to/bar.txt", "bar") tmp.assertEmpty("staged/targets") tmp.assertEmpty("staged") + + //Same function above for non-top target meta + tmp.writeStagedTarget("path/to/hop.txt", "hop") + c.Assert(r.DelegateAddTarget("role01.json", "path/to/hop.txt", nil), IsNil) + tmp.assertExists("staged/role01.json") + c.Assert(r.Snapshot(CompressionTypeNone), IsNil) + c.Assert(r.Timestamp(), IsNil) + c.Assert(r.Commit(), IsNil) + tmp.assertFileContent("repository/targets/ear.txt", "ear") + tmp.assertFileContent("repository/targets/path/to/hop.txt", "hop") + tmp.assertEmpty("staged") } func (rs *RepoSuite) TestCommitFileSystemWithNewRepositories(c *C) { @@ -887,11 +1173,14 @@ func (rs *RepoSuite) TestCommitFileSystemWithNewRepositories(c *C) { genKey(c, newRepo(), "root") genKey(c, newRepo(), "targets") + delegateGenKey(c, newRepo(), "role01") genKey(c, newRepo(), "snapshot") genKey(c, newRepo(), "timestamp") tmp.writeStagedTarget("foo.txt", "foo") c.Assert(newRepo().AddTarget("foo.txt", nil), IsNil) + tmp.writeStagedTarget("bar.txt", "bar") + c.Assert(newRepo().DelegateAddTarget("role01.json", "bar.txt", nil), IsNil) c.Assert(newRepo().Snapshot(CompressionTypeNone), IsNil) c.Assert(newRepo().Timestamp(), IsNil) c.Assert(newRepo().Commit(), IsNil) @@ -905,12 +1194,17 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") tmp.writeStagedTarget("foo.txt", "foo") c.Assert(r.AddTarget("foo.txt", nil), IsNil) tmp.writeStagedTarget("dir/bar.txt", "bar") c.Assert(r.AddTarget("dir/bar.txt", nil), IsNil) + tmp.writeStagedTarget("doi.txt", "doi") + c.Assert(r.DelegateAddTarget("role01.json", "doi.txt", nil), IsNil) + tmp.writeStagedTarget("dir/sec.txt", "sec") + c.Assert(r.DelegateAddTarget("role01.json", "dir/sec.txt", nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) @@ -919,6 +1213,7 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { c.Assert(err, IsNil) c.Assert(versions["root.json"], Equals, 1) c.Assert(versions["targets.json"], Equals, 1) + c.Assert(versions["role01.json"], Equals, 1) c.Assert(versions["snapshot.json"], Equals, 1) hashes, err := r.fileHashes() @@ -946,6 +1241,7 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { // removing a file should remove the hashed files c.Assert(r.RemoveTarget("foo.txt"), IsNil) + c.Assert(r.DelegateRemoveTarget("role01.json", "doi.txt"), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) @@ -954,10 +1250,12 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { c.Assert(err, IsNil) c.Assert(versions["root.json"], Equals, 1) c.Assert(versions["targets.json"], Equals, 2) + c.Assert(versions["role01.json"], Equals, 2) c.Assert(versions["snapshot.json"], Equals, 2) // Save the old hashes for foo.txt to make sure we can assert it doesn't exist later. fooHashes := hashes["targets/foo.txt"] + doiHashes := hashes["targets/doi.txt"] hashes, err = r.fileHashes() c.Assert(err, IsNil) @@ -972,6 +1270,9 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { tmp.assertHashedFilesNotExist("repository/targets/foo.txt", fooHashes) tmp.assertNotExist("repository/targets/foo.txt") + tmp.assertHashedFilesNotExist("repository/targets/doi.txt", doiHashes) + tmp.assertNotExist("repository/targets/doi.txt") + // targets should be returned by new repo newRepo, err := NewRepo(local, "sha512", "sha256") c.Assert(err, IsNil) @@ -981,10 +1282,16 @@ func (rs *RepoSuite) TestConsistentSnapshot(c *C) { if _, ok := t.Targets["dir/bar.txt"]; !ok { c.Fatal("missing targets file: dir/bar.txt") } + d, err := newRepo.delegationTargets("role01.json") + c.Assert(err, IsNil) + c.Assert(d.Targets, HasLen, 1) + if _, ok := d.Targets["dir/sec.txt"]; !ok { + c.Fatal("missing targets file: dir/sec.txt") + } } func (rs *RepoSuite) TestExpiresAndVersion(c *C) { - files := map[string][]byte{"foo.txt": []byte("foo")} + files := map[string][]byte{"foo.txt": []byte("foo"), "bar.txt": []byte("bar")} local := MemoryStore(make(map[string]json.RawMessage), files) r, err := NewRepo(local) c.Assert(err, IsNil) @@ -1003,10 +1310,12 @@ func (rs *RepoSuite) TestExpiresAndVersion(c *C) { genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") c.Assert(r.AddTargets([]string{}, nil), IsNil) + c.Assert(r.DelegateAddTargets("role01.json", []string{}, nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) @@ -1061,6 +1370,26 @@ func (rs *RepoSuite) TestExpiresAndVersion(c *C) { c.Assert(targets.Expires.Unix(), Equals, expires.Round(time.Second).Unix()) c.Assert(targets.Version, Equals, 3) + expires = time.Now().Add(6 * time.Hour) + c.Assert(r.DelegateAddTargetWithExpires("role01.json", "bar.txt", nil, expires), IsNil) + c.Assert(r.Snapshot(CompressionTypeNone), IsNil) + c.Assert(r.Timestamp(), IsNil) + c.Assert(r.Commit(), IsNil) + temp, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) + c.Assert(temp.Expires.Unix(), Equals, expires.Round(time.Second).Unix()) + c.Assert(temp.Version, Equals, 2) + + expires = time.Now().Add(2 * time.Hour) + c.Assert(r.DelegateRemoveTargetWithExpires("role01.json", "bar.txt", expires), IsNil) + c.Assert(r.Snapshot(CompressionTypeNone), IsNil) + c.Assert(r.Timestamp(), IsNil) + c.Assert(r.Commit(), IsNil) + temp, err = r.delegationTargets("role01.json") + c.Assert(err, IsNil) + c.Assert(temp.Expires.Unix(), Equals, expires.Round(time.Second).Unix()) + c.Assert(temp.Version, Equals, 3) + expires = time.Now().Add(time.Hour) c.Assert(r.SnapshotWithExpires(CompressionTypeNone, expires), IsNil) c.Assert(r.Timestamp(), IsNil) @@ -1068,7 +1397,7 @@ func (rs *RepoSuite) TestExpiresAndVersion(c *C) { snapshot, err := r.snapshot() c.Assert(err, IsNil) c.Assert(snapshot.Expires.Unix(), Equals, expires.Round(time.Second).Unix()) - c.Assert(snapshot.Version, Equals, 6) + c.Assert(snapshot.Version, Equals, 8) root, err = r.root() c.Assert(err, IsNil) @@ -1080,7 +1409,7 @@ func (rs *RepoSuite) TestExpiresAndVersion(c *C) { c.Assert(r.Commit(), IsNil) snapshot, err = r.snapshot() c.Assert(err, IsNil) - c.Assert(snapshot.Version, Equals, 7) + c.Assert(snapshot.Version, Equals, 9) expires = time.Now().Add(10 * time.Minute) c.Assert(r.TimestampWithExpires(expires), IsNil) @@ -1088,18 +1417,18 @@ func (rs *RepoSuite) TestExpiresAndVersion(c *C) { timestamp, err := r.timestamp() c.Assert(err, IsNil) c.Assert(timestamp.Expires.Unix(), Equals, expires.Round(time.Second).Unix()) - c.Assert(timestamp.Version, Equals, 8) + c.Assert(timestamp.Version, Equals, 10) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) timestamp, err = r.timestamp() c.Assert(err, IsNil) - c.Assert(timestamp.Version, Equals, 9) + c.Assert(timestamp.Version, Equals, 11) c.Assert(timestamp.Meta["snapshot.json"].Version, Equals, snapshot.Version) } func (rs *RepoSuite) TestHashAlgorithm(c *C) { - files := map[string][]byte{"foo.txt": []byte("foo")} + files := map[string][]byte{"foo.txt": []byte("foo"), "bar.txt": []byte("bar")} local := MemoryStore(make(map[string]json.RawMessage), files) type hashTest struct { args []string @@ -1115,8 +1444,10 @@ func (rs *RepoSuite) TestHashAlgorithm(c *C) { c.Assert(err, IsNil) genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") c.Assert(r.AddTarget("foo.txt", nil), IsNil) + c.Assert(r.DelegateAddTarget("role01.json", "bar.txt", nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) @@ -1130,10 +1461,14 @@ func (rs *RepoSuite) TestHashAlgorithm(c *C) { c.Assert(err, IsNil) timestamp, err := r.timestamp() c.Assert(err, IsNil) + temp, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) for name, file := range map[string]data.FileMeta{ "foo.txt": targets.Targets["foo.txt"].FileMeta, + "bar.txt": temp.Targets["bar.txt"].FileMeta, "root.json": snapshot.Meta["root.json"].FileMeta, "targets.json": snapshot.Meta["targets.json"].FileMeta, + "role01.json": snapshot.Meta["role01.json"].FileMeta, "snapshot.json": timestamp.Meta["snapshot.json"].FileMeta, } { for _, hashAlgorithm := range test.expected { @@ -1218,6 +1553,7 @@ func (rs *RepoSuite) TestManageMultipleTargets(c *C) { c.Assert(r.Init(false), IsNil) genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") @@ -1230,17 +1566,32 @@ func (rs *RepoSuite) TestManageMultipleTargets(c *C) { } } } + assertDelegateRepoTargets := func(paths ...string) { + d, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) + for _, path := range paths { + if _, ok := d.Targets[path]; !ok { + c.Fatalf("missing target file: %s", path) + } + } + } // adding and committing multiple files moves correct targets from staged -> repository tmp.writeStagedTarget("foo.txt", "foo") tmp.writeStagedTarget("bar.txt", "bar") c.Assert(r.AddTargets([]string{"foo.txt", "bar.txt"}, nil), IsNil) + tmp.writeStagedTarget("sin.txt", "sin") + tmp.writeStagedTarget("cos.txt", "cos") + c.Assert(r.DelegateAddTargets("role01.json", []string{"sin.txt", "cos.txt"}, nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) assertRepoTargets("foo.txt", "bar.txt") tmp.assertExists("repository/targets/foo.txt") tmp.assertExists("repository/targets/bar.txt") + assertDelegateRepoTargets("sin.txt", "cos.txt") + tmp.assertExists("repository/targets/sin.txt") + tmp.assertExists("repository/targets/cos.txt") // adding all targets moves them all from staged -> repository count := 10 @@ -1264,6 +1615,7 @@ func (rs *RepoSuite) TestManageMultipleTargets(c *C) { // removing all targets removes them from the repository and targets.json c.Assert(r.RemoveTargets(nil), IsNil) + c.Assert(r.DelegateRemoveTargets("role01.json", nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) @@ -1278,10 +1630,14 @@ func (rs *RepoSuite) TestCustomTargetMetadata(c *C) { "foo.txt": []byte("foo"), "bar.txt": []byte("bar"), "baz.txt": []byte("baz"), + "sin.txt": []byte("sin"), + "cos.txt": []byte("cos"), + "tan.txt": []byte("tan"), } local := MemoryStore(make(map[string]json.RawMessage), files) r, err := NewRepo(local) c.Assert(err, IsNil) + delegateGenKey(c, r, "role01") custom := json.RawMessage(`{"foo":"bar"}`) assertCustomMeta := func(file string, custom *json.RawMessage) { @@ -1294,6 +1650,17 @@ func (rs *RepoSuite) TestCustomTargetMetadata(c *C) { c.Assert(target.Custom, DeepEquals, custom) } + delegateCustom := json.RawMessage(`{"trig":"trig"}`) + delegateAssertCustomMeta := func(file string, custom *json.RawMessage) { + d, err := r.delegationTargets("role01.json") + c.Assert(err, IsNil) + target, ok := d.Targets[file] + if !ok { + c.Fatalf("missing target file: %s", file) + } + c.Assert(target.Custom, DeepEquals, custom) + } + // check custom metadata gets added to the target c.Assert(r.AddTarget("foo.txt", custom), IsNil) assertCustomMeta("foo.txt", &custom) @@ -1308,6 +1675,18 @@ func (rs *RepoSuite) TestCustomTargetMetadata(c *C) { assertCustomMeta("baz.txt", nil) assertCustomMeta("bar.txt", nil) assertCustomMeta("foo.txt", &custom) + + c.Assert(r.DelegateAddTarget("role01.json", "sin.txt", delegateCustom), IsNil) + delegateAssertCustomMeta("sin.txt", &delegateCustom) + + c.Assert(r.DelegateAddTarget("role01.json", "cos.txt", nil), IsNil) + delegateAssertCustomMeta("cos.txt", nil) + delegateAssertCustomMeta("sin.txt", &delegateCustom) + + c.Assert(r.DelegateAddTargets("role01.json", nil, nil), IsNil) + delegateAssertCustomMeta("tan.txt", nil) + delegateAssertCustomMeta("cos.txt", nil) + delegateAssertCustomMeta("sin.txt", &delegateCustom) } func (rs *RepoSuite) TestUnknownKeyIDs(c *C) { @@ -1318,6 +1697,7 @@ func (rs *RepoSuite) TestUnknownKeyIDs(c *C) { genKey(c, r, "root") genKey(c, r, "targets") + delegateGenKey(c, r, "role01") genKey(c, r, "snapshot") genKey(c, r, "timestamp") @@ -1334,6 +1714,7 @@ func (rs *RepoSuite) TestUnknownKeyIDs(c *C) { // commit the metadata to the store. c.Assert(r.AddTargets([]string{}, nil), IsNil) + c.Assert(r.DelegateAddTargets("role01.json", []string{}, nil), IsNil) c.Assert(r.Snapshot(CompressionTypeNone), IsNil) c.Assert(r.Timestamp(), IsNil) c.Assert(r.Commit(), IsNil) diff --git a/verify/db.go b/verify/db.go index 8bc80a3c..1f17c780 100644 --- a/verify/db.go +++ b/verify/db.go @@ -50,15 +50,17 @@ var validRoles = map[string]struct{}{ "timestamp": {}, } +//ValidRole checks if the role can be operated +//Parameter: name of a Role func ValidRole(name string) bool { _, ok := validRoles[name] return ok } func (db *DB) AddRole(name string, r *data.Role) error { - if !ValidRole(name) { - return ErrInvalidRole - } + //if !ValidRole(name) { + // return ErrInvalidRole + //} if r.Threshold < 1 { return ErrInvalidThreshold } diff --git a/verify/verify.go b/verify/verify.go index eb618ae0..1e2fc313 100644 --- a/verify/verify.go +++ b/verify/verify.go @@ -24,9 +24,13 @@ func (db *DB) Verify(s *data.Signed, role string, minVersion int) error { if err := json.Unmarshal(s.Signed, sm); err != nil { return err } - if strings.ToLower(sm.Type) != strings.ToLower(role) { - return ErrWrongMetaType + switch role { + case "root", "targets", "snapshot", "timestamp": + if strings.ToLower(sm.Type) != strings.ToLower(role) { + return ErrWrongMetaType + } } + if IsExpired(sm.Expires) { return ErrExpired{sm.Expires} }