-
Notifications
You must be signed in to change notification settings - Fork 108
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
Master-Secret calculation inconsistent with SPDM specification #987
Comments
@annarossa , good catch! |
@jyao1 In the specification |
Checking libspdm/library/spdm_secured_message_lib/libspdm_secmes_session.c Lines 237 to 242 in 97d23cb
They must be consistent. |
Since they are not consistent, one of them is wrong. |
Sure we can make libspdm consistent, but we don't know if it's consistent with the specification, because the specification doesn't define which parameter in |
I think the answer is here: https://datatracker.ietf.org/doc/html/rfc5869 2.1 Notation
|
Ok, then Master-Secret is correct, it is Handshake-Secret that is wrong. |
The SPDM specification says
So 5869 is only used for |
I am filing SPDM spec issue to get it clarified - https://github.com/DMTF/Security-TF/issues/2076 Assuming HMAC-Hash(salt, IKM) == HMAC(key, input data), we need fix handshake secret calculation, right? |
Correct, though we should delay the Q2 checkpoint until the specification is resolved and this issue needs to be broadcast widely since it effects interoperability and (possibly) security. It seems like folks that are implementing non-libspdm endpoints haven't made it to session establishment, and that's why we haven't run into this issue sooner. |
In master_secret calculation salt and IKM seem to have swapped places.
In DSP0274_1.2.0 (paragraph 738 & 742) for Master-Secret salt is Salt_1 and IKM is 0_filled, and in the code it is otherwise.
master_secret calculation:
libspdm/library/spdm_secured_message_lib/libspdm_secmes_session.c
Lines 424 to 427 in 97d23cb
libspdm/include/library/spdm_crypt_lib.h
Lines 722 to 724 in 97d23cb
The text was updated successfully, but these errors were encountered: