nvme: Add length field to Hkdf-Expand-Label computation#737
nvme: Add length field to Hkdf-Expand-Label computation#737hreinecke merged 1 commit intolinux-nvme:masterfrom
Conversation
|
Can you give a pointer to the HKDF specification where this is mandated? |
RFC 8446 section 7.1 defines HKDF-Expand-Label function which is used to derive the retained-PSK and TLS-PSK: https://datatracker.ietf.org/doc/html/rfc8446#section-7.1 As per RFC8446:
I don't see any implication to the current NVMe/TCP-TLS kernel implementation. |
Fix to add the 2 byte length field to the HKDF-Expand-Label computation for retained and TLS PSK.
bda48bc to
0d20547
Compare
|
Looks reasonable to me. I wonder if we couldn't add some unit test for this. |
Do you want me to add unit tests for this workflow ? |
|
If it is feasible to add a unit test I'd rather have one now than later. When support for TP8018 is added, we just update the unit test. |
|
Currently, nvme_insert_tls_key() is the only global function that is exposed by the library. This function destroys the local copy of the keys once they are inserted into the key ring and returns only a key-serial-number to the caller. Calling this function from the test code will not let us validate the computed keys. derive_nvme_keys(), derive_retained_key() and derive_tls_key() are the static functions where all the real computations happen. So, I don't think it is feasible to writing tests that validate the Retained and TLS PSK that is computed from a configured PSK input. |
|
Indeed, that change looks good. |
Fix to add the 2 byte length field to the HKDF-Expand-Label computation for retained and TLS PSK.
#735