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

Add sanity check for configuration method #8262

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

embhorn
Copy link
Member

@embhorn embhorn commented Dec 6, 2024

Description

Adds a check in settings.h to see if the configuration method has been set. Otherwise set a compiler error.

This should help the frequently reported issue when the application does not include options.h before other wolfSSL headers.

There is a new macro to override this error: WOLFSSL_CUSTOM_CONFIG

Also fixed header include order in

  • examples/echoclient/echoclient.c
  • tests/srp.c
  • testsuite/testsuite.c
  • sslSniffer/sslSnifferTest/snifftest.c
  • mcapi/mcapi_test.c

Fixes zd18968

Testing

Comment out the options.h include in any application. This will now result in:

In file included from /usr/local/include/wolfssl/ssl.h:33,
                 from client-tls.c:37:
/usr/local/include/wolfssl/wolfcrypt/settings.h:336:6: error: #error "No configuration for wolfSSL detected, check header order"
  336 |     #error "No configuration for wolfSSL detected, check header order"
      |      ^~~~~
/usr/local/include/wolfssl/wolfcrypt/settings.h:3708:14: warning: #warning "For timing resistance / side-channel attack prevention consider using harden options" [-Wcpp]
 3708 |             #warning "For timing resistance / side-channel attack prevention consider using harden options"
      |              ^~~~~~~

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Dec 6, 2024
@embhorn embhorn requested a review from douzzer December 9, 2024 16:19
@embhorn embhorn assigned douzzer and unassigned embhorn Dec 9, 2024
embhorn and others added 2 commits December 9, 2024 12:59
…lfssl/wolfcrypt/types.h with refinements; refine logic+message of assert in wolfssl/wolfcrypt/settings.h re "wolfssl/options.h included in compiled wolfssl library object..".
@embhorn embhorn assigned wolfSSL-Bot and unassigned douzzer Dec 9, 2024
@embhorn embhorn requested review from JacobBarthelmeh and removed request for douzzer December 9, 2024 21:40
…guration for wolfSSL detected, check header order", to avoid unnecessary breakage of old projects with nonstandard custom settings.
@douzzer
Copy link
Contributor

douzzer commented Dec 9, 2024

retest this please (unit.test failure on PRB-dtls.txt_36)

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