Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credential and key parsing: Validate match #346

Open
chrysn opened this issue Feb 11, 2025 · 0 comments
Open

Credential and key parsing: Validate match #346

chrysn opened this issue Feb 11, 2025 · 0 comments

Comments

@chrysn
Copy link
Collaborator

chrysn commented Feb 11, 2025

With the exposed API, a Python program (and, without some deeper knowledge, even a Rust program) that loads a private key and a credential has no way of finding out that the configured credential does not match the provided private key.

Steps I suggest for enhancing the API, at least from a Python PoV:

  • Take the private key as a private key object, alternatively (similar to how we take an AutoCredential)
  • Give the private key object a method to verify that any given credential matches it. (I'm not sure our crypto API has the tools to do that; worst case, it can be done by generating a key pair and verifying that GXY = GYX).
  • By-catch (and that'll be good for algorithm agility anyhow): Add a constructor for the private key object that parses a COSE key, and a serializer. (Nice extra property: once a key is loaded, the Python program can't access it any more outside EDHOC).
  • By-catch: Have key pair generation produce a key object.

@geonnave, is there a plan for #277 yet? (That'd influence how the private key object is best done)

Blocks: chrysn/aiocoap#377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant