Add WOLFSSL_BARMETAL macro#9426
Closed
jackctj117 wants to merge 5 commits into
Closed
Conversation
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: jack@wolfssl.com <jack@wolfssl.com>
dgarske
requested changes
Nov 13, 2025
dgarske
left a comment
Member
There was a problem hiding this comment.
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
Member
|
Jenkins retest this please |
Member
|
Closing this PR and will re-open in a fork. |
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
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