-
Notifications
You must be signed in to change notification settings - Fork 901
Add WOLFSSL_BARMETAL macro #9426
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
Open
jackctj117
wants to merge
5
commits into
master
Choose a base branch
from
BAREMETAL-macro
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
dgarske
requested changes
Nov 13, 2025
- Remove WOLFCRYPT_ONLY from WOLFSSL_BAREMETAL macro Users should enable it separately via --enable-cryptonly - Make NO_ASN_TIME conditional on WOLFCRYPT_ONLY Only define NO_ASN_TIME when WOLFCRYPT_ONLY is already defined Add comment explaining this is for systems without RTC This allows users to use --enable-baremetal for bare-metal builds without forcing crypto-only mode, while still providing the option to disable certificate date checking when building crypto-only. Co-Authored-By: [email protected] <[email protected]>
dgarske
requested changes
Nov 13, 2025
Contributor
dgarske
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Is it possible to setup a CI build to test this and add a bit of documentation like the PR description has?
dgarske
requested changes
Nov 14, 2025
dgarske
approved these changes
Nov 14, 2025
dgarske
requested changes
Nov 14, 2025
dgarske
approved these changes
Nov 14, 2025
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.
Description
Adds
--enable-baremetalconfigure option andWOLFSSL_BAREMETALmacro to simplify configuration for bare-metal embedded systems. This option encapsulates commonly-used defines for bare-metal environments into a single flag.The
WOLFSSL_BAREMETALmacro defines:SINGLE_THREADED- No threading supportNO_DEV_RANDOM- No /dev/random accessNO_FILESYSTEM- No file system accessNO_WRITEV- No writev() system callNO_STDIO_FILESYSTEM- No stdio-based file operationsWOLFSSL_NO_SOCK- No socket supportWOLFSSL_NO_GETPID- No process ID supportNO_ASN_TIME- Conditionally defined only whenWOLFCRYPT_ONLYis also defined. For systems without RTC, this bypasses certificate date checking.Important: Users must provide their own entropy source when using this configuration since
NO_DEV_RANDOMis defined. Implementwc_GenerateSeed()with platform-specific hardware RNG.Changes based on reviewer feedback:
WOLFCRYPT_ONLYfrom the macro - users should enable it separately via--enable-cryptonlyif neededNO_ASN_TIMEconditional onWOLFCRYPT_ONLYto avoid forcing certificate date checking to be disabledTesting
Tested with autotools build system:
Tested with both flags:
Tested with CMake build system:
Verified that
WOLFSSL_BAREMETALin settings.h correctly defines all component macros when enabled, and thatNO_ASN_TIMEis only defined whenWOLFCRYPT_ONLYis also present.Checklist
Review Focus Areas
#ifdef WOLFCRYPT_ONLYwrapper aroundNO_ASN_TIMEis the intended behaviorwc_GenerateSeed()implementation - consider if this needs additional documentation