linux: TLS PSK derivation fixes#1040
Merged
igaw merged 1 commit intolinux-nvme:masterfrom Jul 24, 2025
Merged
Conversation
There are issues with the Retained and TLS PSK derivations due to the
implementation not adhering to the RFC 8446 definition of the
HKDF-Expand-Label function.
1) The 16-bit HkdfLabel.length value must be converted to network byte
order.
2) The variable length HkdfLabel.label and HkdfLabel.context vectors
must be prefixed with a length byte.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20250721021718.1159879-2-cleech@redhat.com
Signed-off-by: Chris Leech <cleech@redhat.com>
8f91307 to
f3949db
Compare
Collaborator
|
Thanks! |
Collaborator
|
Bzzt. That patch is wrong. Setting the hkdf 'info' string in derived_retained_key() is now completely garbled. |
Collaborator
|
Alright, I'll revert it in this case. edit: I am reverting it because I wanted to do a release today and this would not be so great to have it in the release |
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.
I was attempting to debug connecting the Linux driver / libnvme /
ktls-utils host stack to the SPDK nvmf_tgt over TLS, and ran into some
issues.
The TLS connection fails to complete a handshake because the TLS PSKs
are different. The NVMe/TCP specified key derivation steps from the
configured interchange format, to a retained PSK and finally the TLS
PSK, is implemented incompatibly in libnvme and SPDK. After some
investigation, I believe the SPDK implementation to be correct and am
providing a libnvme patch to match it. With libnvme modified, I see the
TLS handshake complete in tlshd.