Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
ffb219a
Refactor meta-wolfssl: modularize feature enablement and centralize h…
night1rider Nov 10, 2025
871848e
Merged refactor and new test changes
Nov 12, 2025
885c99c
Combine refactor changes and add replace default and fips modes
Nov 12, 2025
e79dc15
Add working and tested fips, replace default, non-fips, non-replace-d…
Nov 13, 2025
fea3943
Add FIPS replace default to layers and test all options
Nov 15, 2025
4e1b1a0
Refactor bbappends to be more yocto like
Nov 17, 2025
de1946f
Add overide to openssl configure
aidangarske Nov 19, 2025
903f75d
Address comment concerns
aidangarske Nov 19, 2025
ae5ccd6
Only do neccesary simlinks
aidangarske Nov 19, 2025
fa2ca9c
Only do neccesary simlinks
aidangarske Nov 19, 2025
c4d8819
Convert wolfprovider test bbappend to inc file
aidangarske Nov 21, 2025
7cc8405
Add Image minimals for all wolfprovider modes
aidangarske Nov 22, 2025
0d5cb63
Fully tested images
aidangarske Nov 24, 2025
be24f59
Get conf files from source
aidangarske Nov 25, 2025
8bb7f3f
Fix FIPS package issues
LinuxJedi Nov 12, 2025
f84c9b3
Fix unstable meta data for fips package
night1rider Nov 13, 2025
cfd3cf5
Fix the execution command for QEMU
LinuxJedi Nov 13, 2025
54731ec
gnutls-wolfssl layers
gasbytes Nov 6, 2025
7e38eae
fips support
gasbytes Nov 12, 2025
8f4d00b
Removed hmac generation and installation since this step is already
gasbytes Nov 13, 2025
93b3302
gnutls layers (from https://github.com/wolfSSL/meta-wolfssl/pull/111/)
gasbytes Nov 13, 2025
68bc4d8
- added gnutls-image-minimal;
gasbytes Nov 20, 2025
d63f2ff
added do_configure[network] = "1" to the inc file (fixes networking i…
gasbytes Nov 21, 2025
4cb3148
Add support for GCP and tarballs
LinuxJedi Nov 18, 2025
438a79b
fix stamp.h in append rather than main .bb
aidangarske Nov 25, 2025
45d7926
Update wolfprovider include files with local changes
aidangarske Nov 25, 2025
e088894
Add messages for debug files
aidangarske Nov 25, 2025
bbe26c7
Follow Debian convention for provider config in openssl.cnf
aidangarske Nov 26, 2025
239e917
Append conf fil
aidangarske Nov 26, 2025
00ac650
Don't use fixed version for FIPS
LinuxJedi Nov 25, 2025
108bcc4
Fix naming for new fips rename
aidangarske Nov 26, 2025
ce05463
Add final wolfprovider refactor changes
aidangarske Nov 27, 2025
f350ce3
Benchmark and GPG Error Patch to resolve build issues and disable ben…
night1rider Nov 25, 2025
58ff717
Fixes for when GNUPG is needed
night1rider Nov 26, 2025
cb312d0
Update wolfProvider images to match other demo images,
night1rider Nov 27, 2025
1d54635
Fips Image for reference
night1rider Nov 27, 2025
8c49a2a
Fix openssl target detection
LinuxJedi Nov 28, 2025
38614ed
Add symlink in ossl-modules, install provider.conf from main module
padelsbach Dec 3, 2025
458b26d
Remove debug for wolfprovider
aidangarske Dec 4, 2025
6a5fbab
Add fix for loading conf in wolfproviderenv
aidangarske Dec 8, 2025
0258e8e
linuxkm: add non-FIPS kernel module recipe and initramfs integration …
sameehj Dec 3, 2025
6ed2681
Add openssl ptest patch
padelsbach Dec 8, 2025
a3de087
Fix openssl patch
aidangarske Dec 11, 2025
1bfaf61
linuxkm: update to latest commit to include randomness changes for Te…
sameehj Dec 11, 2025
c815847
Add wolfssl-kernel-random.bbclass for kernel randomness patches
sameehj Dec 11, 2025
a5a706e
Add curl ptest patch
padelsbach Dec 8, 2025
141b3a6
Make RD and FIPS detection more robust
aidangarske Dec 11, 2025
2663fd3
Refactor to handle all cases
aidangarske Dec 11, 2025
995f8e9
Wrong file location for curl .inc
night1rider Dec 15, 2025
f9e0bf6
- Updated gnutls to point to the 3.8.11 branch to get the 3.8.11 version
gasbytes Dec 17, 2025
d8bdf0c
Add fix for wolfProvider curl FIPS
aidangarske Dec 18, 2025
d4e0576
Add openssh ptest patch for wolfprovider
padelsbach Dec 10, 2025
0479b58
Fix location of openSSH patch to point to upstream osp
night1rider Dec 19, 2025
b3dc4c4
linuxkm-fips: add Yocto recipe
sameehj Dec 15, 2025
732047a
Wolfprovider patch fix and other cleanup
padelsbach Dec 17, 2025
e0e5088
Add librelp ptest patch for FIPS
padelsbach Dec 17, 2025
b2b23f2
Add support for wolfProvider RD unit test
aidangarske Dec 19, 2025
7b32079
Add replace default method for fips image
aidangarske Dec 22, 2025
84e9f81
Update rev for wolfProvider
aidangarske Dec 23, 2025
4e2d52f
Update wolfProvider ref
aidangarske Dec 26, 2025
885b575
Update ref version for pr 347
aidangarske Jan 1, 2026
26197b1
fixing compatability and file layout for .incs porting
night1rider Jan 6, 2026
4857719
fix pathing for gcrypt patch file
night1rider Jan 7, 2026
434b6ce
Merge pull request #151 from night1rider/compatibility-fixes
LinuxJedi Jan 7, 2026
7851a7d
FIPS-off gnutls recipes + minimal fips-off image.
gasbytes Jan 6, 2026
58e451c
Update ref version for cmd test specific commit to pr 347
aidangarske Jan 8, 2026
420d786
Merge pull request #153 from aidangarske/update-wolfprovider-pr347
night1rider Jan 8, 2026
d5fe517
fix buggy paths in meta-wolfssl
aidangarske Jan 9, 2026
19ab03e
Merge pull request #154 from aidangarske/curl-fips-refactor-fix2
night1rider Jan 9, 2026
75e9318
Fix issue with missing config script and also add gcs to linuxkm recipe
night1rider Jan 12, 2026
076c151
Move commercial bundle evaluation outside of recipes and into bbclass
night1rider Jan 12, 2026
366dde7
Merge pull request #152 from gasbytes/gnutls-wolfssl-fips-off
night1rider Jan 15, 2026
59488cd
Update src ref to WP 354 for final cmd line fix
aidangarske Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
recipes-wolfssl/wolfssl/commercial/files/wolfssl*
*.7z
*.zip

# User-specific FIPS configuration (created from conf/wolfssl-fips.conf.sample)
conf/wolfssl-fips.conf
334 changes: 334 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ This layer currently provides recipes for the following wolfSSL products:
- [wolfCrypt-py A Python Wrapper for the wolfCrypt API](https://github.com/wolfSSL/wolfcrypt-py)
- [wolfPKCS11 A PKCS#11 implementation using wolfSSL](https://github.com/wolfSSL/wolfpkcs11)

This layer also provides Open Source Package (OSP) integrations:

- [libgcrypt with wolfSSL backend](recipes-support/libgcrypt/README.md) - Use wolfSSL FIPS as the crypto backend for libgcrypt

These recipes have been tested using these versions of yocto:

- Scarthgap (v5.0)
Expand Down Expand Up @@ -51,15 +55,34 @@ Clone meta-wolfssl onto your machine:
git clone https://github.com/wolfSSL/meta-wolfssl.git
```

### Layer Dependencies

**For FIPS Builds Only:** If you plan to use the `wolfssl-fips` recipe, you must also include the `meta-openembedded/meta-oe` layer, which provides `p7zip-native` for extracting commercial FIPS bundles. Non-FIPS builds do not require this dependency.

```
git clone https://github.com/openembedded/meta-openembedded.git
```

After installing your build's Yocto/OpenEmbedded components:

1. Insert the 'meta-wolfssl' layer in `build/conf/bblayers.conf` location
into your build's bblayers.conf
file, in the BBLAYERS section:

**For non-FIPS builds:**
```
BBLAYERS ?= " \
...
/path/to/yocto/poky/meta-wolfssl \
...
"
```

**For FIPS builds (includes meta-oe):**
```
BBLAYERS ?= " \
...
/path/to/meta-openembedded/meta-oe \
/path/to/yocto/poky/meta-wolfssl \
...
"
Expand Down Expand Up @@ -119,6 +142,105 @@ After installing your build's Yocto/OpenEmbedded components:
build, which could increase the size of the build and turn on uneeded
features.

Using WOLFSSL_FEATURES Variable
--------------------------------

As an alternative to `IMAGE_INSTALL`, you can use the `WOLFSSL_FEATURES` variable
in your `local.conf` to enable specific wolfSSL features. This ensures wolfSSL
packages are configured correctly but doesn't automatically add them to every
image recipe:

```
WOLFSSL_FEATURES:append = " wolfclu wolfssh wolfmqtt wolftpm"
```

Add this to your `build/conf/local.conf` file.

When you specify a package in `WOLFSSL_FEATURES` or `IMAGE_INSTALL`, the layer
automatically configures wolfSSL with the necessary `--enable-*` options for that
package. The key difference:
- `IMAGE_INSTALL`: Adds packages to your image AND configures wolfSSL
- `WOLFSSL_FEATURES`: Only configures wolfSSL, packages must be added separately

**Method 3: Manual .bbappend (Advanced)**

If you don't want to use `IMAGE_INSTALL` or `WOLFSSL_FEATURES`, you can manually
create a `wolfssl_%.bbappend` file in your own layer that includes the necessary
`.inc` files for the features you need. For example, if you need wolfclu and wolfssh
support, create a `wolfssl_%.bbappend` file:

```
# In your-layer/recipes-wolfssl/wolfssl/wolfssl_%.bbappend
require inc/wolfclu/wolfssl-enable-wolfclu.inc
require inc/wolfssh/wolfssl-enable-wolfssh.inc
```

Or point to the meta-wolfssl layer directly:

```
require ${COREBASE}/../meta-wolfssl/inc/wolfclu/wolfssl-enable-wolfclu.inc
require ${COREBASE}/../meta-wolfssl/inc/wolfssh/wolfssl-enable-wolfssh.inc
```

**Important**: When using this method, you must also create `.bbappend` files for each
package you want to use. A convenience `.inc` file is provided to disable the feature
check. For example:

```
# In your-layer/recipes-wolfssl/wolfclu/wolfclu_%.bbappend
require inc/wolfssl-manual-config.inc

# In your-layer/recipes-wolfssl/wolfssh/wolfssh_%.bbappend
require inc/wolfssl-manual-config.inc
```

Or point to the meta-wolfssl layer directly:

```
require ${COREBASE}/../meta-wolfssl/inc/wolfssl-manual-config.inc
```

Commercial Bundles from Google Cloud Storage
--------------------------------------------

BitBake ships with a GCS fetcher. To use it with `wolfssl-fips`:

1. Upload the commercial tarball to a private bucket (for example
`gs://wolfssl-commercial-artifacts/releases/5.8.2/wolfssl-5.8.2-commercial-fips-linux.tar.gz`).
2. Set the commercial variables plus the GCS URI in `conf/local.conf` (or your
distro .conf):

```
WOLFSSL_SRC = "wolfssl-5.8.2-commercial-fips-linux"
WOLFSSL_SRC_SHA = "<sha256 from wolfSSL portal>"
WOLFSSL_BUNDLE_FILE = "${WOLFSSL_SRC}.tar.gz"
WOLFSSL_BUNDLE_GCS_URI = "gs://wolfssl-commercial-artifacts/releases/5.8.2/${WOLFSSL_BUNDLE_FILE}"
```

3. The recipe pulls in `${WOLFSSL_LAYERDIR}/inc/wolfssl-fips/wolfssl-commercial-gcs.inc`, which:
- Points `SRC_URI` at the `gs://` location (with the checksum);
- Disables the custom 7zip extraction task;
- Lets BitBake handle download and unpack for tarballs.

4. Host requirements for the BitBake GCS fetcher:
- Install the Google Cloud SDK (which provides the GCS client libraries) by following https://docs.cloud.google.com/sdk/docs/install.
- Ensure the Python `google` namespace is present; on RPM-based installs the `google-cloud-cli` package does **not** ship the Python libraries, so also install `python3-google-cloud-core` (or `pip install --user google-cloud-core`) before running BitBake.
- For private buckets, authenticate with `gcloud auth application-default login` or set `GOOGLE_APPLICATION_CREDENTIALS` to a service-account JSON before running BitBake.

For password-protected `.7z` bundles, keep `WOLFSSL_BUNDLE_FILE` unset (the
class will assume `<NAME>.7z`), provide `COMMERCIAL_BUNDLE_PASS`, and place the
archive where `COMMERCIAL_BUNDLE_DIR` points (or supply a `gs://…` URI plus
checksum). In that case the 7zip helper remains enabled and requires
`p7zip-native`.

The `inc/wolfssl-manual-config.inc` file can be used for any wolfSSL package. It
disables the automatic validation check that looks for `IMAGE_INSTALL` or
`WOLFSSL_FEATURES`. Remember to also include the corresponding `wolfssl-enable-*.inc`
file(s) in your `wolfssl_%.bbappend` to configure wolfSSL with the necessary features.

This gives you complete control over which wolfSSL features are enabled without
relying on automatic detection.

Once your image has been built, the default location for the wolfSSL library
on your machine will be in the "/usr/lib" directory.

Expand Down Expand Up @@ -244,6 +366,140 @@ When your image builds, these will be installed to the '/usr/bin' system
directory. When inside your executing image, you can run them from the
terminal.

wolfSSL Demo Images
-------------------

This layer includes several pre-configured demo images for testing various wolfSSL
sub-packages. Each image is a minimal Yocto image based on `core-image-minimal` with
specific wolfSSL components installed and configured.

For detailed information about each demo image, including structure, configuration
methods, and testing instructions, see [recipes-core/README.md](recipes-core/README.md).

### Enabling Demo Images

To enable a demo image, add the following to your `conf/local.conf`:

```
WOLFSSL_DEMOS = "wolfssl-image-minimal <additional-image-name>"
```

**Important**: All demo images (except `wolfssl-image-minimal` itself) require
`wolfssl-image-minimal` to be included in `WOLFSSL_DEMOS` because they inherit from it.

You can then build the image with:

```
$ bitbake <image-name>
```

### Available Demo Images

1. **wolfssl-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal"`
- Provides: wolfSSL library, wolfcrypttest, wolfcryptbenchmark
- Description: Base minimal image with wolfSSL and core crypto testing tools

2. **wolfclu-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolfclu-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + wolfCLU
- Description: Demonstrates wolfCLU command-line tools

3. **wolftpm-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolftpm-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + wolfTPM + TPM 2.0 tools
- Requirements: Add to `local.conf`:
```
DISTRO_FEATURES += "security tpm tpm2"
MACHINE_FEATURES += "tpm tpm2"
KERNEL_FEATURES += "features/tpm/tpm.scc"
```
- Testing: Use `test-wolftpm.sh` script in the image directory to run with swtpm.
Once booted, run `/usr/bin/wolftpm-wrap-test`

4. **wolfssl-py-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolfssl-py-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + Python bindings (wolfssl-py,
wolfcrypt-py, wolf-py-tests) + Python 3 with cffi and pytest
- Note: For all wolfssl-py tests to pass, you will need to configure networking in
the QEMU environment (DNS resolvers, network connectivity, etc.)

5. **wolfprovider-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolfprovider-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + wolfProvider +
wolfprovidertest + OpenSSL 3.x
- Description: Demonstrates wolfProvider as an OpenSSL 3.x provider

6. **wolfssl-combined-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolfssl-combined-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + wolfssh + wolfmqtt +
wolfProvider + wolftpm + TPM 2.0 tools
- Requirements: Add to `local.conf`:
```
DISTRO_FEATURES += "security tpm tpm2"
MACHINE_FEATURES += "tpm tpm2"
KERNEL_FEATURES += "features/tpm/tpm.scc"
```
- Description: Comprehensive image combining multiple wolfSSL sub-packages

7. **wolfclu-combined-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal wolfclu-combined-image-minimal"`
- Provides: Everything from `wolfssl-image-minimal` + wolfCLU + Python bindings
(wolfssl-py, wolfcrypt-py, wolf-py-tests) + Python 3 with cffi and pytest +
DNS configuration + ca-certificates
- Description: Combines wolfCLU with Python bindings and networking support

8. **libgcrypt-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "wolfssl-image-minimal libgcrypt-image-minimal"`
- Requires: `require /path/to/meta-wolfssl/conf/wolfssl-fips.conf` (wolfSSL FIPS bundle)
- Provides: Everything from `wolfssl-image-minimal` + libgcrypt with wolfSSL backend +
libgcrypt-ptest + ptest-runner
- Description: Demonstrates libgcrypt using wolfSSL FIPS as the crypto backend. Enables
FIPS-validated cryptography for all applications using libgcrypt (GnuPG, systemd, etc.)
- Testing: Run `ptest-runner libgcrypt` in QEMU to verify the wolfSSL backend
- More Info: See [recipes-support/libgcrypt/README.md](recipes-support/libgcrypt/README.md)
and [recipes-core/images/libgcrypt-image-minimal/README.md](recipes-core/images/libgcrypt-image-minimal/README.md)

### Building Multiple Demo Images

You can enable multiple demo images by space-separating them. Remember to always
include `wolfssl-image-minimal` first:

```
WOLFSSL_DEMOS = "wolfssl-image-minimal wolfclu-image-minimal wolfssl-py-image-minimal"
```

### Standalone Demo Images

These images do not require `wolfssl-image-minimal` in WOLFSSL_DEMOS:

1. **fips-image-minimal**
- Enable with: `WOLFSSL_DEMOS = "fips-image-minimal"`
- Requires: `require /path/to/meta-wolfssl/conf/wolfssl-fips.conf` (wolfSSL FIPS bundle)
- Provides: libgcrypt with wolfSSL FIPS backend + gnutls with wolfSSL FIPS backend +
wolfProvider in replace-default mode + OpenSSL 3.x + test utilities
- Description: Comprehensive FIPS image demonstrating wolfSSL FIPS integration with
libgcrypt, gnutls, and wolfProvider. All crypto operations use wolfSSL FIPS as the backend.

Then build each image individually:

```
$ bitbake wolfssl-image-minimal
$ bitbake wolfclu-image-minimal
$ bitbake wolfssl-py-image-minimal
```

### Running Demo Images

After building, run images with QEMU using:

```
$ runqemu <image-name>
```

For images with special requirements (like `wolftpm-image-minimal`), use the provided
test scripts in the image directory.

Excluding Recipe from Build
---------------------------

Expand Down Expand Up @@ -440,6 +696,84 @@ For building FIPS and/or commercial bundles of wolfSSL products view the instruc

To gain access to these bundles contact support@wolfssl.com to get a qoute.

### Using wolfssl-fips Recipe

The layer provides a `wolfssl-fips` recipe that uses BitBake's `virtual/wolfssl` provider mechanism, allowing you to seamlessly swap between open-source, FIPS, and commercial versions of wolfSSL.

#### What is virtual/wolfssl?

`virtual/wolfssl` is an abstract interface that can be provided by multiple recipes:
- `wolfssl` (open-source) - Default provider from meta-networking
- `wolfssl-fips` (FIPS-validated) - Provided by this layer
- Future: `wolfssl-commercial` - For commercial non-FIPS bundles

When you set `PREFERRED_PROVIDER_virtual/wolfssl = "wolfssl-fips"`, all recipes that depend on `virtual/wolfssl` will automatically use the FIPS-validated version instead of the standard open-source version.

#### Setup Instructions

1. **Copy the configuration template:**
```bash
cd meta-wolfssl
cp conf/wolfssl-fips.conf.sample conf/wolfssl-fips.conf
```

2. **Edit `conf/wolfssl-fips.conf` with your FIPS bundle details:**
- `WOLFSSL_SRC_DIR` - Directory containing your commercial archive
- `WOLFSSL_SRC` - Logical bundle name (without extension)
- `WOLFSSL_BUNDLE_FILE` - Optional, set to `${WOLFSSL_SRC}.tar.gz` for tarballs
- `WOLFSSL_SRC_PASS` - Bundle password (only needed for `.7z`)
- `WOLFSSL_LICENSE` - License file name (typically in bundle)
- `WOLFSSL_LICENSE_MD5` - MD5 checksum of license file
- `FIPS_HASH` - FIPS integrity hash (auto-generated on first build if using auto mode)
- `WOLFSSL_FIPS_HASH_MODE` - `"auto"` (QEMU-based) or `"manual"` (static hash)

3. **Include the configuration in your `build/conf/local.conf`:**
```bitbake
# Use absolute path to the config file
require /path/to/meta-wolfssl/conf/wolfssl-fips.conf
```

The configuration will automatically:
- Set `PREFERRED_PROVIDER_virtual/wolfssl = "wolfssl-fips"`
- Set `PREFERRED_PROVIDER_wolfssl = "wolfssl-fips"`
- Configure FIPS bundle extraction and validation

4. **Build your image or package:**
```bash
bitbake <your-image>
```

#### FIPS Hash Modes

The layer supports two modes for FIPS integrity hash generation:

**Auto Mode (Recommended):**
```bitbake
WOLFSSL_FIPS_HASH_MODE = "auto"
```
- Automatically extracts hash by building with placeholder, running test binary via QEMU
- Works for all architectures
- No manual hash management needed

**Manual Mode:**
```bitbake
WOLFSSL_FIPS_HASH_MODE = "manual"
FIPS_HASH = "YOUR_HASH_HERE"
```
- Uses static hash value from config
- Requires you to obtain and set the hash manually

#### File Security

The `conf/wolfssl-fips.conf` file is automatically ignored by git (via `.gitignore`), keeping your bundle password and license information private. Only the `.sample` template is tracked in git.

#### Benefits

- **Seamless switching:** Change provider in one place, all recipes adapt
- **No recipe modifications:** Existing recipes work unchanged
- **Automatic configuration:** FIPS features and hash extraction handled automatically
- **Security:** Credentials stay local and private

Maintenance
-----------

Expand Down
Loading