rpmb: move into a plugin and split into subcommands - #3889
Merged
Conversation
RPMB is not part of the NVMe base specification -- it reuses Security Send/Receive as transport but the protocol itself is a Micron-originated vendor extension. Move it out of the always-built src/ core into an optional nvme-cli plugin (plugins/rpmb/), alongside security and sed. While moving it, split the single nvme rpmb --cmd=<action> command into one subcommand per action (info, program-key, read-counter, read-data, write-data, read-config, write-config), each with only the options it needs, instead of one flag-driven mega-command. There is no deprecated alias for the old --cmd= form since there's no 1:1 mapping to preserve. Also fixes a few latent bugs found while touching this code: a malloc()/libnvme_free() allocator mismatch in read_rpmb_key(), a missing NULL check after calloc() in auth_data_write_chunk(), rpmb --cmd=info always returning a failure exit code, and the target option being parsed with OPT_UINT into a char field. Signed-off-by: Daniel Wagner <dwagner@suse.com>
Contributor
Author
This statement is not correct. it is part of the spec. Though it still makes sense to move into a plugin. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RPMB is not part of the NVMe base specification -- it reuses Security Send/Receive as transport but the protocol itself is a Micron-originated vendor extension. Move it out of the always-built src/ core into an optional nvme-cli plugin (plugins/rpmb/), alongside security and sed.
While moving it, split the single nvme rpmb --cmd= command into one subcommand per action (info, program-key, read-counter, read-data, write-data, read-config, write-config), each with only the options it needs, instead of one flag-driven mega-command. There is no deprecated alias for the old --cmd= form since there's no 1:1 mapping to preserve.
Also fixes a few latent bugs found while touching this code: a malloc()/libnvme_free() allocator mismatch in read_rpmb_key(), a missing NULL check after calloc() in auth_data_write_chunk(), rpmb --cmd=info always returning a failure exit code, and the target option being parsed with OPT_UINT into a char field.