-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix build failures when NO_AES_DECRYPT is defined #11448
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16964,16 +16964,18 @@ static wc_test_ret_t aes_no_key_set_test(void) | |
| if (wc_AesGcmEncrypt(aes, cipher, plain, WC_AES_BLOCK_SIZE, iv, sizeof(iv), | ||
| tag, sizeof(tag), NULL, 0) != WC_NO_ERR_TRACE(MISSING_KEY)) | ||
| ERROR_OUT(WC_TEST_RET_ENC_NC, out); | ||
| #if defined(HAVE_AES_DECRYPT) || defined(HAVE_AESGCM_DECRYPT) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mode-specific decrypt paths lack successful-operation coverage · Weak or missing assertions The new branches only assert Suggested fix: Run successful decrypt and authentication-failure KATs under the corresponding GCM and CCM mode-specific guards. |
||
| if (wc_AesGcmDecrypt(aes, cipher, plain, WC_AES_BLOCK_SIZE, iv, sizeof(iv), | ||
| tag, sizeof(tag), NULL, 0) != WC_NO_ERR_TRACE(MISSING_KEY)) | ||
| ERROR_OUT(WC_TEST_RET_ENC_NC, out); | ||
| #endif | ||
| #endif | ||
|
|
||
| #ifdef HAVE_AESCCM | ||
| if (wc_AesCcmEncrypt(aes, cipher, plain, WC_AES_BLOCK_SIZE, iv, 13, | ||
| tag, sizeof(tag), NULL, 0) != WC_NO_ERR_TRACE(MISSING_KEY)) | ||
| ERROR_OUT(WC_TEST_RET_ENC_NC, out); | ||
| #ifdef HAVE_AES_DECRYPT | ||
| #if defined(HAVE_AES_DECRYPT) || defined(HAVE_AESCCM_DECRYPT) | ||
| if (wc_AesCcmDecrypt(aes, cipher, plain, WC_AES_BLOCK_SIZE, iv, 13, | ||
| tag, sizeof(tag), NULL, 0) != WC_NO_ERR_TRACE(MISSING_KEY)) | ||
| ERROR_OUT(WC_TEST_RET_ENC_NC, out); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cavium GCM-only decrypt build lacks its helper · Missing/incorrect platform conditionals
NitroxAesGcmDecrypt()is emitted when onlyHAVE_AESGCM_DECRYPTis set, but itsNitroxAesDecrypt()callee remains underHAVE_AES_DECRYPT; CaviumNO_AES_DECRYPTbuilds fail. Adjacent #8240 concerns IV padding, not this guard.Related known finding #8240 (similar but distinct): Both affect the Cavium Nitrox GCM decrypt wrapper, but #8240 passes uninitialized IV-tail bytes to hardware, whereas this candidate conditionally omits NitroxAesDecrypt and breaks GCM-only builds. The faulting operations, root causes, and required patches differ.
Suggested fix: Guard
NitroxAesDecrypt()withHAVE_AES_DECRYPT || HAVE_AESGCM_DECRYPT, while keeping CBC entry points restricted toHAVE_AES_DECRYPT.Basis: ISO/IEC 9899:1990 §6.7 requires an external definition for an identifier with external linkage that is used in an expression.