Skip to content

FileMeta verification guidance with client store representations #249

Open

Description

@asraa

sigstore/root-signing#376 (comment)
@kommendorkapten brought up this issue during a change where we used to serve canonicalized repository metadata, and just now switched to normal encoding/json. This technically changes the bytes that are used to calculate the FileMeta checksum and lengths, for example, used in the timestamp.json file for pinning the snapshot.

If clients write metadata to their trusted store in canonicalized form, or in some other representation other than the bytes that were directly received from the repository, then the checksums of their stored metadata no longer match the ones in the trusted FileMeta.

This is particularly important if we have a shared cache that multiple TUF client implementations share: if one writes as canonicalized bytes, and the other in the direct bytes received, then one client will fail depending on the way that the repository wrote the FileMeta.

Should clients ALWAYS write metadata to their trusted store in the exact form that was received from the remote?
Should FileMeta ALWAYS be generated from the canonicalized bytes that were signed?

Activity

  1. trishankatdatadog commented on Sep 22, 2022

    @trishankatdatadog
    Contributor

    Should clients ALWAYS write metadata to their trusted store in the exact form that was received from the remote?
    Should FileMeta ALWAYS be generated from the canonicalized bytes that were signed?

    Seems like a reasonable (albeit slightly expensive) workaround for now. Does anyone else have better ideas?

  2. lukpueh commented on Oct 3, 2022

    @lukpueh
    Member

    Should clients ALWAYS write metadata to their trusted store in the exact form that was received from the remote?
    Should FileMeta ALWAYS be generated from the canonicalized bytes that were signed?

    It's either one or the other, right? If the repo creates FileMeta from the exact metadata bytes it serves, and the client uses exactly those bytes to compute the hash, then no canonicalization is needed. I think this is how the spec pictures it.

    Using a canonical form of the full(!) metadata (not only the signed bytes like) would be an alternative, if above is not possible.

    Another alternative would be to generate FileMeta without hashes as described in Mercury.

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