Add support for creating keys from pin#3220
Merged
igaw merged 4 commits intolinux-nvme:masterfrom Mar 31, 2026
Merged
Conversation
Sort alphabetically the symbols. Signed-off-by: Daniel Wagner <[email protected]>
e95e3ed to
c3d376d
Compare
Move helper function to create the raw secret from the input string to the library. This allows to use a common function to consistently create the raw secret in nvme-cli and libnvme. For testing purposes it is also helpful to generate a secret based from a pin. Use the pin as seed and create the raw secret with a simple algorithm: function create_key(seed, key_len): output = [] counter = 0 while length(output) < key_len: hash = HASH(seed || encode(counter)) output += hash counter += 1 return output[0:key_len] Signed-off-by: Daniel Wagner <[email protected]>
Introduce function to release all resource associated to a fabrics context. This allows makes the opaque data structure more useful inside the library. Signed-off-by: Daniel Wagner <[email protected]>
For testing purpose it is very useful to have proper created secret keys based on a pin. Thus extend nvmf_context_set_crypto to transform the pin secret into a proper key. Signed-off-by: Daniel Wagner <[email protected]>
c3d376d to
5d8b815
Compare
Collaborator
Author
|
@poettering IIRC you were asking for this feature. Here we go :) |
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.
For testing purpose it is very useful to have proper created secret keys
based on a pin.
To generate a new secret for the target:
and then to connect from the host:
The key generation uses following algorithm: