Skip to content

Conversation

@dgarske
Copy link
Contributor

@dgarske dgarske commented Nov 21, 2025

Description

Adds --enable-baremetal configure option and WOLFSSL_BAREMETAL macro to simplify configuration for bare-metal embedded systems. This option encapsulates commonly-used defines for bare-metal environments into a single flag.

The WOLFSSL_BAREMETAL macro defines:

  • SINGLE_THREADED - No threading support
  • NO_DEV_RANDOM - No /dev/random access
  • NO_FILESYSTEM - No file system access
  • NO_WRITEV - No writev() system call
  • NO_STDIO_FILESYSTEM - No stdio-based file operations
  • WOLFSSL_NO_SOCK - No socket support
  • WOLFSSL_NO_GETPID - No process ID support
  • NO_ASN_TIME - Conditionally defined only when WOLFCRYPT_ONLY is 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_RANDOM is defined. Implement wc_GenerateSeed() with platform-specific hardware RNG.

Changes based on reviewer feedback:

  • Removed WOLFCRYPT_ONLY from the macro - users should enable it separately via --enable-cryptonly if needed
  • Made NO_ASN_TIME conditional on WOLFCRYPT_ONLY to avoid forcing certificate date checking to be disabled

Testing

Tested with autotools build system:

./autogen.sh
./configure --enable-baremetal
grep WOLFSSL_BAREMETAL wolfssl/options.h  # Verified macro is defined
# Verified NO_ASN_TIME is NOT defined with just --enable-baremetal
make clean && make

Tested with both flags:

./configure --enable-baremetal --enable-cryptonly
# Verified NO_ASN_TIME IS defined when WOLFCRYPT_ONLY is present
make clean && make

Tested with CMake build system:

mkdir build && cd build
cmake -DWOLFSSL_BAREMETAL=yes ..
make

Verified that WOLFSSL_BAREMETAL in settings.h correctly defines all component macros when enabled, and that NO_ASN_TIME is only defined when WOLFCRYPT_ONLY is also present.

Checklist

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

jackctj117 and others added 5 commits November 21, 2025 14:05
- 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
Copy link
Contributor Author

dgarske commented Nov 24, 2025

Jenkins retest this please

@dgarske dgarske removed their assignment Nov 25, 2025
@kaleb-himes
Copy link
Contributor

For FIPS purposes, baremetal is a scary term that labs and CMVP won't touch. 99.9% of the time systems that would require this setting will actually have Firmware present and won't be truely and completely "baremetal".

This configure option is great for cases where FIPS doesn't matter but if we want to use this feature set on a system with primitive Firmware that isn't truely and completely "baremetal" it would be nice to have an alias that won't scare the CMVP and the CSTL's when they see it in the Module Management Manual or User Guide as we call it.

An alias like --enable-no-os that does exactly the same thing (just an alias for --enable-baremetal) would be nice for validation purposes?

@dgarske dgarske self-assigned this Nov 25, 2025
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