Skip to content

Make signatures deterministic by default? #130

@jku

Description

@jku

#128 seems to be an example of the flaw in current RepositorySimulator signing key & signature management:

  • The design is optimized for minimal test code: this leads to signing metadata (apart from root) at request time
  • The keys are created (in multiple places) with CryptoSigner.generate_ecdsa() because ecdsa keys are fast to generate: this way each test simply generates whatever keys it needs

Unfortunately ecdsa signatures are not deterministic so the combination of these two features can easily lead to issues that are difficult to debug.

Obvious options to fix this include:

  1. start explicitly signing metadata -- I would still like to avoid this if possible
  2. switch to a deterministic signature by default

I think I lean to option 2, we should at least try this with another keytype:

  • ed25519 is maybe not a great option, I'm not sure if every client has support for that. RSA is likely the right default
  • the issue with RSA is the key generation time: in the long term we should not generate keys in every test
    • as the initial implementation we can try generating keys in tests like now, if it's not horribly slow
    • we could also include a list of ~20 hard coded keys in sources and have RepositorySimulator take keys from the list (keys are also generated in test_updater_key_rotations.py and test_keys.py: these should likely use the same source for key material)

Metadata

Metadata

Assignees

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