theupdateframework / tuf-conformance

TUF client conformance test suite
MIT License
7 stars 4 forks source link

test different keytypes/schemes #159

Open jku opened 3 weeks ago

jku commented 3 weeks ago

We should use a default keytype in most tests (currently RSA, ecdsa maybe makes sense after #155). In addition we should have specific tests for support of various other keytypes. Specification does not really require support for any specific keys but these are mentioned in spec:

keytype scheme
rsa rsassa-pss-sha256
ecdsa ecdsa-sha2-nistp256
ed25519 ed25519

We should definitely test these.

Additionally potential testable keys might include keytype scheme note
ecdsa ecdsa-sha2-nistp384
ecdsa ecdsa-sha2-nistp521
ecdsa-sha2-nistp256 ecdsa-sha2-nistp256 legacy keytype name still supported by some implementations
ecdsa-sha2-nistp384 ecdsa-sha2-nistp384 legacy keytype name still supported by some implementations
ecdsa-sha2-nistp521 ecdsa-sha2-nistp521 legacy keytype name still supported by some implementations
rsa rsassa-pss-sha224
rsa rsassa-pss-sha384
rsa rsassa-pss-sha512
rsa rsa-pkcs1v15-sha224
rsa rsa-pkcs1v15-sha256
rsa rsa-pkcs1v15-sha384
rsa rsa-pkcs1v15-sha512
jku commented 3 weeks ago

So I guess we should write a single parametrized test (or one test for the keys mentioned in specification, another for additional keys) that

We could add more pre-generated keys to repository_simulator.py (like RSA_PKCS_SIGNERS) so at least the keys are ready in case we decide to use them in more than one test.

jku commented 3 weeks ago

maybe an additional test: use an incorrect but supported key like ecdsa-sha2-nistp256 but have the metadata claim that it's ecdsa-sha2-nistp521. I think a client should fail this even though it could parse the public key and correctly handle it: as it looks like the repository is trying to mislead a human reader.

jku commented 3 weeks ago

I've got an initial test in #167

jku commented 2 weeks ago

Status:

The only obstacles are: