-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nk3 set-config: Add support for opcard.use_se050_backend
This patch refactors the set-config command: 1. It checks whether the config option is supported by the device using the GET_CONFIG command before any other steps are performed. 2. For known keys that trigger a reset, currently only opcard.use_se050_backend, a warning and a confirmation prompt are shown. 3. Unknown keys are rejected unless --force is set, trigger a warning and require a confirmation prompt. 4. It adds a --dry-run option to check the infos and prompts that are printed for a config change. 5. It adds an automatic reboot if required. Potential improvements: - The metadata for config values should be put into data structures that can also be used by nitrokey-app2. - Information on whether a command triggers a reset and requires touch confirmation could be queried from the device using a new command. - We could validate the configuration values before sending them to the device. - We could compare the current and the new value to detect no-op calls before printing the sermon about side effects.
- Loading branch information
1 parent
c88030e
commit e8fe4f9
Showing
2 changed files
with
95 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters