Skip to content

Capabilities of import_{ed25519,ecdsa}_{private,public}key_from_file don't align with name #280

@lukpueh

Description

@lukpueh

Description of issue or feature request:

securesystemslib has a custom json on-disk format for ed25519 and ecdsa private and public keys. The generate_and_write_{ed25519, ecdsa}_keypair(...) and import_{ed25519, ecdsa}_{private, public}key_from_file functions serialize and deserialize keys to and from this format respectively, and according to their names.

However, as discovered while refactoring the related unit tests in #279, the capabilities of these function exceed the scope that their names suggest.

Current behavior:

  1. import_ed25519_publickey_from_file can import ed25519 private keys (if unencrypted)
  2. import_ed25519_privatekey_from_file can also import public keys
  3. import_ecdsa_publickey_from_file can import ed25519 public keys

Expected behavior:
Fail if the imported key is not what the name of the function suggests.

Also see #251 and secure-systems-lab/dsse#1 for long-term plans of dropping the custom key format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    legacyIssues related to legacy interfaces (obsolete with #731)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions