Skip to content

xtest: AES-GCM Key Wrapping/Unwrapping - #822

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

xtest: AES-GCM Key Wrapping/Unwrapping#822
Hussainity wants to merge 1 commit into
OP-TEE:masterfrom
Hussainity:hm/gcm-keywrap

Conversation

@Hussainity

Copy link
Copy Markdown

Test AES-GCM Key Wrapping and Unwrapping in the PKCS#11 TA. Ensure that round-trip is succesful and that tampered tags are rejected.

@Hussainity

Copy link
Copy Markdown
Author

This PR addresses: OP-TEE/optee_os#7853
Related PKCS11 feature PR: OP-TEE/optee_os#7864

@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.

@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.

LGTM. Some minor comments.
Could you update the commit message header line to something like:

-xtest: AES-GCM Key Wrapping/Unwrapping
+xtest: pkcs11_1031: Test AES GCM key wrapping

Comment thread host/xtest/pkcs11_1000.c Outdated
Comment on lines +10227 to +10228
ADBG_EXPECT_CK_OK(c, C_DestroyObject(session, unwrapped_key));
unwrapped_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.

Could remove these 2 instructions.
If the function failed, no unwrap key should be created. Maybe replace with:

	if (!ADBG_EXPECT_TRUE(c, rv != CKR_OK) ||
	    !ADBG_EXPECT_COMPARE_UNSIGNED(c, unwrapped_key, ==, CK_INVALID_HANDLE))
		goto out;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Agreed, out: takes care of it anyways.

Test AES-GCM Key Wrapping and Unwrapping in the PKCS#11 TA. Ensure that
round-trip is succesful and that tampered tags are rejected.

Signed-off-by: Hussain Miyaziwala <hussain_miya@hotmail.com>
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