Skip to content
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

20240617-fix-wc_Sha256-overalignment #7652

Merged

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Jun 17, 2024

wolfssl/wolfcrypt/sha256.h: in definition of struct wc_Sha256, conditionalize alignment optimization of digest and buffer slots on defined(WC_64BIT_CPU), to avoid overalignment warnings on 32 bit targets. this also fixes overalignment of struct Hmac.

see https://www.wolfssl.com/forums/topic2125-armcc-byte-alignment-cannot-be-greater-than-8-bytes-warning.html

ARMCC reports

wolfcrypt\src\kdf.c(87): warning:  #1041-D: alignment for an auto object may not be larger than 8

With this patch, the alignment of struct Hmac drops from 16 to 8 on 32 bit targets.

tested with wolfssl-multi-test.sh ... sanitizer-all-intelasm-c-fallback-fuzzer cross-aarch64-all-armasm-unittest-sanitizer cross-aarch64-all-noasm-unittest-sanitizer cross-armv7a-all-armasm-testsuite-sanitizer super-quick-check

douzzer added 2 commits June 17, 2024 19:03
…ionalize alignment optimization of digest and buffer slots on defined(WC_64BIT_CPU), to avoid overalignment warnings on 32 bit targets. this also fixes overalignment of struct Hmac.
This reverts commit b7a28cc.

WOLFSSL_AESGCM_STREAM needs to be conditional as arranged by configure.ac.
@douzzer douzzer force-pushed the 20240617-fix-wc_Sha256-overalignment branch from 062ad7f to 87114fa Compare June 18, 2024 00:06
@SparkiDev SparkiDev removed the request for review from dgarske June 18, 2024 00:39
@SparkiDev SparkiDev merged commit a141041 into wolfSSL:master Jun 18, 2024
117 checks passed
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.

4 participants