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

20241102-fixes #8141

Merged
merged 1 commit into from
Nov 4, 2024
Merged

20241102-fixes #8141

merged 1 commit into from
Nov 4, 2024

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Nov 3, 2024

rename MAX_CERT_VERIFY_SZ to WC_MAX_CERT_VERIFY_SZ, and move its setup from wolfssl/internal.h to wolfssl/wolfcrypt/asn.h.

rename WOLFSSL_MAX_RSA_BITS to WC_MAX_RSA_BITS, and move its setup from wolfssl/internal.h to wolfssl/wolfcrypt/asn.h, preceding setup for WC_MAX_CERT_VERIFY_SZ.

configure.ac: restore opensslextra-linuxkm assertion, with a twist: "--enable-opensslextra with --enable-linuxkm-pie and without --enable-cryptonly is incompatible with --enable-linuxkm."

wolfcrypt/src/asn.c: fix trailing comma in enum.

wolfcrypt/src/port/arm/armv8-aes.c: fix wc_AesCcmEncrypt() and wc_AesCcmDecrypt() for test_wolfssl_EVP_aes_ccm_zeroLen().

tested with wolfssl-multi-test.sh ... super-quick-check allcryptonly-gcc-c89 fips-140-2-optest fips-140-2-openssl-all quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest-Os quantum-safe-wolfssl-all-cross-armv7a-armasm-unittest-Os-smallstack

…p from wolfssl/internal.h to wolfssl/wolfcrypt/asn.h.

rename WOLFSSL_MAX_RSA_BITS to WC_MAX_RSA_BITS, and move its setup from wolfssl/internal.h to wolfssl/wolfcrypt/asn.h, preceding setup for WC_MAX_CERT_VERIFY_SZ.

configure.ac: restore opensslextra-linuxkm assertion, with a twist: "--enable-opensslextra with --enable-linuxkm-pie and without --enable-cryptonly is incompatible with --enable-linuxkm."

wolfcrypt/src/asn.c: fix trailing comma in enum.

wolfcrypt/src/port/arm/armv8-aes.c: fix wc_AesCcmEncrypt() and wc_AesCcmDecrypt() for test_wolfssl_EVP_aes_ccm_zeroLen().
#ifndef WC_MAX_RSA_BITS
#ifdef USE_FAST_MATH
/* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
#define WC_MAX_RSA_BITS (FP_MAX_BITS / 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a good place for this. asn.h is private.
Try types.h

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're moving this from internal.h -- it was already private, and until we have a reason to make it non-private we should keep it private.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh and also, we can't put the setup for WC_MAX_RSA_BITS in types.h or settings.h because it depends on tfm.h or sp_int.h, and since WC_MAX_CERT_VERIFY_SZ depends on WC_MAX_RSA_BITS, we can't put setup for WC_MAX_CERT_VERIFY_SZ in types.h or settings.h either.

the setup for this is very finicky, I discovered during dev -- if it's defined wrong, the result is buffer overruns. lost quite a few cycles chasing that down...

@douzzer douzzer requested a review from SparkiDev November 4, 2024 16:44
@dgarske dgarske merged commit 8f2516c into wolfSSL:master Nov 4, 2024
143 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