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

TLS keys handling #894

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

TLS keys handling #894

wants to merge 10 commits into from

Conversation

igaw
Copy link
Collaborator

@igaw igaw commented Oct 10, 2024

Refactor and extend the PSK API and decouple the key store operations from the JSON parsing.

Fixes: #890

Test the pre-shared key interchange format import/export function.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The existing import/export function do not handle different version of
the interchange format nor do the handle the HMAC independent of the
version. Thus allow the caller to select version and HMAC independently
when exporting resp. importing. This makes this interface also future
proof when new HMAC or key lengths are added to the spec.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Also test for nvme_{import|export}_tls_key_versioned API.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The pre-shared key interchange format also has 'no transform' option
when the configured key should be used as retained key. Update the
export/imports to support this case.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Extend the test case also to check
for the NONE and SHA2-384 algorithm

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The config-diff script is expecting a sysfs tar file besides an input
and a output file. Let's make the sysfs tar file optional so we can use
this config diff script more flexible.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Use the inverse x-mas tree pattern for variable declarations.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Extend the ctrl API to allow the users to set the tls_key/keyring on the
ctrl object directly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
When the JSON parser detects a TLS key it inserts it into the keystore.
Keystore operations on the default '.nvme' keyring are privileged
operations (root) thus the parser will fail. This will fail nvme-cli
commands which are run as normal user.

Let's move the key store operations to the connect call path where we
need the right permission. A nice side benefit is that we also are able
to pass in a configured key.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Add a test case for the PSK API to ensure that the generated JSON is
correct.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
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

Successfully merging this pull request may close these issues.

Update JSON handling for TLS keys
1 participant