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

[Feature Request]: firmware should validate private_key and public_key values match when updating settings manually #5486

Open
powersjcb opened this issue Dec 1, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@powersjcb
Copy link

powersjcb commented Dec 1, 2024

Platform

Cross-Platform

Description

Discovered this is not validated after typo'ing a private key value from a screenshot of my backups.

The private and public key values were still valid on their own, but they did not match and therefore couldn't be used for something like PKI admin.

@powersjcb powersjcb added the enhancement New feature or request label Dec 1, 2024
@powersjcb powersjcb changed the title [Feature Request]: firmware should validate private_key and public_key values match [Feature Request]: firmware should validate private_key and public_key values match when updating settings manually Dec 1, 2024
@fifieldt fifieldt added help wanted Extra attention is needed good first issue Good for newcomers labels Dec 5, 2024
@tgies
Copy link

tgies commented Jan 22, 2025

Really, since public key is derived from private key, it seems to me we shouldn't allow setting the public key at all -- just regenerate it from the private key when that is set. Am I missing anything here?

@garthvh
Copy link
Member

garthvh commented Jan 22, 2025

Really, since public key is derived from private key, it seems to me we shouldn't allow setting the public key at all -- just regenerate it from the private key when that is set. Am I missing anything here?

No

@tgies
Copy link

tgies commented Jan 23, 2025

I imagine that, besides a change to the firmware to self-set the public key when the private key is changed and no longer allow manually changing the public key, this would need corresponding changes to all clients so they no longer make it "look like" the public key can be set independently (and in fact no longer try to set it). This might be a little funky to figure out how to handle in the mobile and web app UIs (e.g. should it show a read-only pubkey field, clear it as soon as the user edits the privkey field, and then repopulate it when the configuration is pulled to the client again after the change is committed? or something else?) but I suppose some of that might be a discussion for the clients' respective issue trackers.

Then, there would maybe also need to be a corresponding documentation change to make it clear that the public key is wholly determined by the private key.

I'm willing to start putting together the PRs for this given some consensus about how it should be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants