Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL#552
Open
aidangarske wants to merge 1 commit into
Open
Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL#552aidangarske wants to merge 1 commit into
aidangarske wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a build break when wolfTPM is compiled against coexist-enabled wolfSSL (OPENSSL_COEXIST), where the classic AES_BLOCK_SIZE macro may not be provided and only WC_AES_BLOCK_SIZE is exposed.
Changes:
- Add a guarded compatibility alias in
tpm2_types.hto defineAES_BLOCK_SIZEasWC_AES_BLOCK_SIZEwhen wolfSSL disables the classic name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tpm2_crypto.c(and the fwTPM sources) use the classicAES_BLOCK_SIZE, which recent wolfSSL only exposes whenOPENSSL_COEXISTis not defined — under coexist it providesWC_AES_BLOCK_SIZE(an enum) plus the marker macroWC_NO_COMPAT_AES_BLOCK_SIZE. Building wolfTPM against a coexist-enabled wolfSSL (e.g. the wolfProvider Yocto stack) therefore fails with'AES_BLOCK_SIZE' undeclared.Adds a one-line compat shim in
wolftpm/tpm2_types.h(after the wolfSSL includes) that aliases the classic name toWC_AES_BLOCK_SIZEonly when wolfSSL has withheld it:Since it's in the central types header, it covers every wolfTPM source in one place, and stays inert on non-coexist and older wolfSSL.
Validation: compiled
tpm2_crypto.cagainst real coexist wolfSSL headers — without the shim it reproduces'AES_BLOCK_SIZE' undeclared; with it, compiles cleanly (AES_BLOCK_SIZE == 16). Also confirmed end-to-end in the wolfProvider Yocto build (wolfTPMdo_compilesucceeded).