-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add basic config mechanism for fido2 #337
Conversation
6c60d09
to
7b45985
Compare
One open question is how to deal with default values and what should happen if we decide to change them in future firmware versions. We could skip serializing the application config if it is equal to the default. This would mean that a firmware update with changed default settings would change the existing configuration. |
Generally we should not alter configuration values if they've been set by the user. So skipping serialization if it's the default is ok, once the user changes it, it would automatically persist, right? |
I was thinking about cases where the user deliberately sets the default config. We could add an additional field to indicate manually written configuration, but that would increase the serialized size. |
Ultimately, this is a (client) UI issue. Means I would vote to keep the firmware implementation as simple as possible (as you suggested). Our client software (pynitrokey / nitrokey-app2) should on top then make sure that the user is always well informed. For nkapp2 this means the configuration has to be shown after updating and pynitrokey should do something similar after updating. |
6f05d9c
to
3f976bc
Compare
e88a3d7
to
47ba14c
Compare
Changes since the initial version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch adds a basic config mechanism using the admin app. The configuration is loaded and applied during initialization. The admin app now has a special role, is constructed first and can no longer be disabled. Other applications can receive a reference to the configuration loaded by the admin app. To avoid overwriting configuration values for apps that are not enabled in the current firmware, the components of the Config struct are not feature-gated. It could be simplified by using a derive macro but that seems overcomplicated for a first implementation. The first use case for the config mechanism is enabling or disabling skipping the FIDO2 user presence check directly after boot. Fixes: #344
This patch adds a basic config mechanism using the admin app. The configuration is loaded and applied during initialization. The admin app now has a special role, is constructed first and can no longer be disabled. Other applications can receive a reference to the configuration loaded by the admin app.
To avoid overwriting configuration values for apps that are not enabled in the current firmware, the components of the Config struct are not feature-gated. It could be simplified by using a derive macro but that seems overcomplicated for a first implementation.
The first use case for the config mechanism is enabling or disabling skipping the FIDO2 user presence check directly after boot.
To do