libckteec: add CKM_HKDF_DERIVE mechanism support - #420
Conversation
etienne-lms
left a comment
There was a problem hiding this comment.
LGTM. It would be nice the updates in pkcs11_ta.h in OP-TEE OS are also reported here in libckteec/include/pkcs11_ta.h. Not a blocking issue, could be added later.
| if (params->ulSaltLen > UINT32_MAX || | ||
| params->ulInfoLen > UINT32_MAX || | ||
| params->ulSaltLen > | ||
| UINT32_MAX - params->ulInfoLen - 7 * sizeof(uint32_t)) | ||
| return CKR_ARGUMENTS_BAD; | ||
|
|
||
| params_size = 7 * sizeof(uint32_t) + params->ulSaltLen + | ||
| params->ulInfoLen; |
There was a problem hiding this comment.
| if (params->ulSaltLen > UINT32_MAX || | |
| params->ulInfoLen > UINT32_MAX || | |
| params->ulSaltLen > | |
| UINT32_MAX - params->ulInfoLen - 7 * sizeof(uint32_t)) | |
| return CKR_ARGUMENTS_BAD; | |
| params_size = 7 * sizeof(uint32_t) + params->ulSaltLen + | |
| params->ulInfoLen; | |
| if (ADD_OVERFLOW(7 * sizeof(uint32_t), params->ulSaltLen, ¶ms_size) || | |
| ADD_OVERFLOW(params_size, params->ulInfoLen, ¶ms_size)) | |
| return CKR_ARGUMENTS_BAD; | |
There was a problem hiding this comment.
ADD_OVERFLOW is part of the TA build, not here in OPTEE Client
There was a problem hiding this comment.
My mistake, it's under review (#417). Discard my comment. If that P-R is not merge before yours, we will update the code later to use ADD_OVERFLOW().
|
@etienne-lms Address your feedback. |
|
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
|
Keep alive |
etienne-lms
left a comment
There was a problem hiding this comment.
LGTM.
Reviewed-by: Etienne Carriere <etienne.carriere@st.com>
| if (params->ulSaltLen > UINT32_MAX || | ||
| params->ulInfoLen > UINT32_MAX || | ||
| params->ulSaltLen > | ||
| UINT32_MAX - params->ulInfoLen - 7 * sizeof(uint32_t)) | ||
| return CKR_ARGUMENTS_BAD; | ||
|
|
||
| params_size = 7 * sizeof(uint32_t) + params->ulSaltLen + | ||
| params->ulInfoLen; |
There was a problem hiding this comment.
My mistake, it's under review (#417). Discard my comment. If that P-R is not merge before yours, we will update the code later to use ADD_OVERFLOW().
|
Please apply the tag so I can merge this. |
Define CK_HKDF_PARAMS from PKCS#11 v3.0 and serialize it into the wire format expected by the TA. Signed-off-by: Hussain Miyaziwala <hussain_miya@hotmail.com> Reviewed-by: Etienne Carriere <etienne.carriere@st.com>
|
@jenswikl done! |
|
I'll merge this when the CI tests have passed. |
Define CK_HKDF_PARAMS from PKCS#11 v3.0 and serialize it into the wire format expected by the TA.