Skip to content

repository_lib.py lists signatures in an non-deterministic order #1154

Closed

Description

@erickt

Please fill in the fields below to submit an issue or feature request. The
more information that is provided, the better.

Description of issue or feature request:

When some metadata is signed with multiple keys, tuf/repository_lib.py doesn't write the signatures in a deterministic order. This occurs because of this line. If this line was changed to signing_keyids = sorted(set(roleinfo['signing_keyids'])). I hacked this in and it worked, but I wasn't sure how to write a test for it, and ran out of time.

doesn't sign the metadata in a consistent order, and so it's not guaranteed to generate the same file if metadata is resigned with the same keys. This came up in the go-tuf interoperability test suite, where each time I regenerated the metadata I might get different file hashes.

Current behavior:

It's not guaranteed what order signatures are written in.

Expected behavior:

Signatures to be sorted in some order. My proposal is we just do alphabetical order.

Activity

  1. trishankatdatadog commented on Sep 28, 2020

    @trishankatdatadog
    Contributor

    Yes, we might as well do this, but are we also fixing entropy during the tests? Because signatures themselves are not necessarily deterministic...

  2. added
    repository
    good first issue
    on Sep 30, 2020
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

    good first issuerepository

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions