Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Conversation

@whh39
Copy link
Contributor

@whh39 whh39 commented Aug 28, 2023

For symmetric key, keyusage must be EH_KEYUSAGE_ENCRYPT_DECRYPT

@whh39 whh39 mentioned this pull request Aug 28, 2023

if ((cmk->metadata.keyusage == EH_KEYUSAGE_SIGN_VERIFY && cmk->metadata.keyspec == EH_AES_GCM_128) ||
(cmk->metadata.keyusage == EH_KEYUSAGE_SIGN_VERIFY && cmk->metadata.keyspec == EH_AES_GCM_192) ||
(cmk->metadata.keyusage == EH_KEYUSAGE_SIGN_VERIFY && cmk->metadata.keyspec == EH_AES_GCM_256) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

why not put this check into the switch...case dispatcher function, e.g,
ehsm_create_aes_key(cmk);
ehsm_create_sm4_key(cmk);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, that's better

For symmetric key, keyusage must be EH_KEYUSAGE_ENCRYPT_DECRYPT

Signed-off-by: wanghaiheng <haihengx.wang@intel.com>
@syan10 syan10 merged commit 6c3e27e into intel:main Aug 29, 2023
@whh39 whh39 deleted the fix branch October 19, 2023 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants