Skip to content

Snapshot.json example is missing hash(es) and size for the root role #31

Closed

Description

@erickt

In section 4.6 of the spec, the description of the snapshot.json file states:

The snapshot.json file is signed by the snapshot role. It lists the version numbers of all metadata on the repository, excluding timestamp.json and mirrors.json. For the root role, the hash(es), size, and version number are listed.

However, the example does not include the hashes or size for the root.json file:

 {
 "signatures": [
  {
   "keyid": "fce9cf1cc86b0945d6a042f334026f31ed8e4ee1510218f198e8d3f191d15309",
   "sig": "f7f03b13e3f4a78a23561419fc0dd741a637e49ee671251be9f8f3fceedfc112e4
           4ee3aaff2278fad9164ab039118d4dc53f22f94900dae9a147aa4d35dcfc0f"
  }
 ],
 "signed": {
  "_type": "snapshot",
  "spec_version": "1",
  "expires": "2030-01-01T00:00:00Z",
  "meta": {
   "root.json": {
    "version": 1
   },
   "targets.json": {
    "version": 1
   },
   "project.json": {
    "version": 1
    },
   }
  "version": 1
  },
 }

Could they be added?

Also, I've seen mentioned in a few places that TAP 5 removes the need to actually include the root in the snapshot file, but I'm not sure if TAP 5 is integrated into the spec, or is just planned to be incorporated in some future version of TUF.

Activity

  1. erickt commented on Jan 29, 2019

    @erickt
    ContributorAuthor

    It looks like these values were present way back when, but was removed in theupdateframework/python-tuf#466. Should this line be removed from the spec?

    For the root role, the hash(es), size, and version number are listed.

    Or Perhaps rephrased to this to be backwards compatible?

    For the root role, the hash(es) and size may be listed.

  2. trishankatdatadog commented on Jan 29, 2019

    @trishankatdatadog
    Contributor

    @erickt The complication is that it is actually permissible to list hashes (if not sizes) for all metadata files (other than the timestamp, which is never listed) in the snapshot. See Section 5.6 of the Mercury paper. It's just that the reference implementation hasn't implemented it yet.

  3. erickt commented on Mar 24, 2019

    @erickt
    ContributorAuthor

    @trishankatdatadog Yeah that sounds like a reasonable defense. Would it be reasonable to extend the example for snapshot.json to add a delegation that lists the hash(es) and size in order to encourage clients to consume them if they are available?

  4. trishankatdatadog commented on Mar 25, 2019

    @trishankatdatadog
    Contributor

    @erickt, yes, please. In fact, we should not even list root.json (just like timestamp.json) in snapshot.json anymore. Right @JustinCappos ?

  5. JustinCappos commented on Mar 28, 2019

    @JustinCappos
    Member
  6. lukpueh commented on Apr 26, 2019

    @lukpueh
    Member

    I just noticed that docs/METADATA.md also carries misleading (outdated) information in that regard. There is no mention of version numbers, or exclusion of root.json but instead it says:

    The snapshot.json metadata file lists hashes and sizes of all metadata files other than timestamp.json

    Btw. all sample snapshot.json files in the reference implementation also list root.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions