You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repository_lib.py lists signatures in an non-deterministic order #1154
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.
Reacted by Trishank Karthik Kuppusamy, Jussi Kukkonen, Lukas Pühringer and Joshua Lock
Activity
trishankatdatadog commentedon Sep 28, 2020
Yes, we might as well do this, but are we also fixing entropy during the tests? Because signatures themselves are not necessarily deterministic...