Skip to content

Does timestamp.json still require length and hashes? #38

Closed

Description

@erickt

In 4.6 of the spec, the timestamp role METAFILES is described as:

METAFILES is the same is described for the snapshot.json file. In the case of the timestamp.json file, this will commonly only include a description of the snapshot.json file.

Where the METAFILES described in snapshot.json is:

METAFILES is an object whose format is the following:

 { METAPATH : {
       "version" : VERSION }
   , ...
 }
METAPATH is the metadata file's path on the repository relative to the metadata base URL.

VERSION is listed for the root file and all other roles available on the repository.

However, the example in the spec includes the size and hashes field:

...
 "signed": {
  "_type": "timestamp",
  "spec_version": "1",
  "expires": "2030-01-01T00:00:00Z",
  "meta": {
   "snapshot.json": {
    "hashes": {
     "sha256": "c14aeb4ac9f4a8fc0d83d12482b9197452f6adf3eb710e3b1e2b79e8d14cb681"
    },
    "length": 1007,
    "version": 1
   }
...

Are the length and hashes field optional for the timestamp.json role, or are they required? I'm not sure if the arguments made in theupdateframework/python-tuf#451 and theupdateframework/python-tuf#465 to make these fields optional for the snapshot role also apply to the timestamp role.

Activity

  1. trishankatdatadog commented on Mar 25, 2019

    @trishankatdatadog
    Contributor

    Since timestamp.json is always constant size in practice (but even if attackers inflate the file, we have upper bounds on downloading files in practice), this is not a problem. It would be appreciated if you could send a PR clarifying this :)

  2. awwad commented on Apr 4, 2019

    @awwad
    Contributor

    As to Eric's question about the hashes:

    The TUF specification is currently written to require that timestamp list hashes for snapshot, yes; this is explicit in 2.1.4 in the spec.

    I cannot now think of a reason that the hash of snapshot in timestamp (instead of just the version of snapshot in timestamp) is really that helpful. I may be forgetting something. Anyone else?

    (And to be clear, yeah, Eric, your spec quotes make it clear that it's worth a little cleanup where the Timestamp section refers to Snapshot's meta section but they don't actually have the same requirements. 😃)

  3. added 4 commits that reference this issue on Feb 5, 2020
    90c2efd
    17e6516
    af91a93
    97312dd
  4. added a commit that references this issue on Mar 3, 2020
    4202bab
  5. added a commit that references this issue on Mar 5, 2020
    0c73d44
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