Skip to content

Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL#552

Open
aidangarske wants to merge 1 commit into
wolfSSL:masterfrom
aidangarske:fix-aes-block-size-coexist
Open

Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL#552
aidangarske wants to merge 1 commit into
wolfSSL:masterfrom
aidangarske:fix-aes-block-size-coexist

Conversation

@aidangarske

@aidangarske aidangarske commented Jul 13, 2026

Copy link
Copy Markdown
Member

tpm2_crypto.c (and the fwTPM sources) use the classic AES_BLOCK_SIZE, which recent wolfSSL only exposes when OPENSSL_COEXIST is not defined — under coexist it provides WC_AES_BLOCK_SIZE (an enum) plus the marker macro WC_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 to WC_AES_BLOCK_SIZE only when wolfSSL has withheld it:

#if defined(WC_NO_COMPAT_AES_BLOCK_SIZE) && !defined(AES_BLOCK_SIZE)
    #define AES_BLOCK_SIZE WC_AES_BLOCK_SIZE
#endif

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.c against 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 (wolfTPM do_compile succeeded).

Copilot AI review requested due to automatic review settings July 13, 2026 23:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.h to define AES_BLOCK_SIZE as WC_AES_BLOCK_SIZE when wolfSSL disables the classic name.

@aidangarske aidangarske marked this pull request as ready for review July 14, 2026 16:48
@aidangarske aidangarske changed the title Fix AES_BLOCK_SIZE undec when built with OPENSSL_COEXIST wolfSSL Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL Jul 14, 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