Skip to content

xtest: include tests for HKDF_DERIVE - #819

Open
Hussainity wants to merge 1 commit into
OP-TEE:masterfrom
Hussainity:hm/hkdf
Open

xtest: include tests for HKDF_DERIVE#819
Hussainity wants to merge 1 commit into
OP-TEE:masterfrom
Hussainity:hm/hkdf

Conversation

@Hussainity

Copy link
Copy Markdown

Test HKDF_DERIVE in PKCS#11 TA using RFC 5869 test vectors.

@etienne-lms etienne-lms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this test series.
I think it would be nice to have a few tests on reference keys access permissions (base key & salt key). Could be added in a later change.

Could you mention in the commit message that only some of the RFC 5869 test vectors are exercised? It also would be nice to provide an URL for the test vector location in the commit message, e.g. Link: https://www.rfc-editor.org/info/rfc5869/#appendix-A.

Comment thread host/xtest/pkcs11_1000.c Outdated
Comment on lines +10320 to +10325
if (derived_key != CK_INVALID_HANDLE)
ADBG_EXPECT_CK_OK(c, C_DestroyObject(session, derived_key));
if (base_key != CK_INVALID_HANDLE)
ADBG_EXPECT_CK_OK(c, C_DestroyObject(session, base_key));
derived_key = CK_INVALID_HANDLE;
base_key = CK_INVALID_HANDLE;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Destroying object could be factorized in hkdf_derive_and_get() as well as derived_key and base_key local variables.

Comment thread host/xtest/pkcs11_1000.c Outdated
ADBG_EXPECT_CK_OK(c, close_lib());
}
ADBG_CASE_DEFINE(pkcs11, 1031, xtest_pkcs11_test_1031,
"PKCS11: HKDF derive (RFC 5869 A.1-A.4, extract/expand modes, salt-as-key, negatives)");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: test case summary could be shorten to ease adding other tests.

Suggested change
"PKCS11: HKDF derive (RFC 5869 A.1-A.4, extract/expand modes, salt-as-key, negatives)");
"PKCS11: HKDF derive (RFC 5869 test vectors based and negative tests)");

Test HKDF_DERIVE in PKCS#11 TA using RFC 5869 test vectors.
Only some of the RFC 5869 vectors are included here.
Link to source: https://datatracker.ietf.org/doc/html/rfc5869.

Signed-off-by: Hussain Miyaziwala <hussain_miya@hotmail.com>
@Hussainity

Copy link
Copy Markdown
Author

@etienne-lms , thanks for the review, I have addressed your comments.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

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 pull request at any time.

@github-actions github-actions Bot added the Stale label Aug 9, 2026
@Hussainity

Copy link
Copy Markdown
Author

not stale, optee os changes pending

@github-actions github-actions Bot removed the Stale label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants