Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 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
0f9843b
Cleanup to readmes
night1rider Jan 16, 2026
3f3371c
remove the need for the librelp patch
night1rider Feb 2, 2026
9046ac2
Update emails to point at support email
night1rider Feb 2, 2026
4efa746
add Gnutls images to the main readme
night1rider Feb 2, 2026
491ba41
Fix typo in example for wolfprovider meta-data and update licensing t…
night1rider Feb 2, 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
915 changes: 621 additions & 294 deletions README.md

Large diffs are not rendered by default.

327 changes: 327 additions & 0 deletions classes/wolfssl-commercial.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
# wolfssl-commercial.bbclass
#
# This class provides helper functions for commercial wolfSSL bundles
# including password-protected 7z extraction and autogen disabling
#
# Usage in recipe:
# inherit wolfssl-commercial
#
# Required variables:
# COMMERCIAL_BUNDLE_DIR - Directory containing the commercial archive
# COMMERCIAL_BUNDLE_NAME - Logical bundle name (used as extracted directory)
# COMMERCIAL_BUNDLE_PASS - Password for .7z bundles (optional for .tar.gz)
# COMMERCIAL_BUNDLE_SHA - SHA256 checksum of the bundle
# COMMERCIAL_BUNDLE_TARGET - Target directory for extraction (usually WORKDIR)
#
# Example:
# COMMERCIAL_BUNDLE_DIR = "${@os.path.dirname(d.getVar('FILE'))}/commercial/files"
# COMMERCIAL_BUNDLE_NAME = "${WOLFSSL_SRC}"
# COMMERCIAL_BUNDLE_PASS = "${WOLFSSL_SRC_PASS}"
# COMMERCIAL_BUNDLE_SHA = "${WOLFSSL_SRC_SHA}"
# COMMERCIAL_BUNDLE_TARGET = "${WORKDIR}"
#
# Helper functions:
# get_commercial_src_uri(d) - Generates conditional SRC_URI
# get_commercial_source_dir(d) - Generates conditional source directory
# get_commercial_bbclassextend(d) - Returns BBCLASSEXTEND only if bundle configured
# get_commercial_bundle_archive(d) - Resolves bundle filename (supports .7z and .tar.gz)
#
# Optional format variables:
# COMMERCIAL_BUNDLE_FILE - Bundle filename including extension (defaults to <NAME>.7z)
# COMMERCIAL_BUNDLE_GCS_URI - gs:// path to the protected bundle
# COMMERCIAL_BUNDLE_SRC_DIR - Direct path to already-extracted source directory (skips fetch/extract)

# Commercial bundles already ship generated configure scripts, so skip autoreconf
AUTOTOOLS_AUTORECONF = "no"

# Helper functions for conditional commercial bundle configuration
def append_libtool_sysroot(d):
"""Override the default autotools helper to drop --with-libtool-sysroot for commercial bundles."""
if d.getVar('COMMERCIAL_BUNDLE_ENABLED') == "1":
return ''
import bb
if not bb.data.inherits_class('native', d):
return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
return ''

def get_commercial_bundle_archive(d):
"""Resolve the bundle filename with extension."""
bundle_file = d.getVar('COMMERCIAL_BUNDLE_FILE')
if bundle_file and bundle_file.strip() and not bundle_file.startswith('${'):
return bundle_file
bundle_name = d.getVar('COMMERCIAL_BUNDLE_NAME')
if bundle_name and bundle_name.strip() and not bundle_name.startswith('${'):
return f'{bundle_name}.7z'
return ''

def get_commercial_src_uri(d):
"""Generate SRC_URI for commercial bundle if configured, dummy file otherwise"""
# Check for direct source directory first (skip fetch/extract)
src_dir = d.getVar('COMMERCIAL_BUNDLE_SRC_DIR')
if src_dir and src_dir.strip() and not src_dir.startswith('${'):
# Direct source directory - no fetch needed
return ""

bundle_archive = d.getVar('COMMERCIAL_BUNDLE_ARCHIVE')
bundle_sha = d.getVar('COMMERCIAL_BUNDLE_SHA')
gcs_uri = d.getVar('COMMERCIAL_BUNDLE_GCS_URI')
placeholder = d.getVar('COMMERCIAL_BUNDLE_PLACEHOLDER') or ''

if gcs_uri and bundle_archive:
unpack_flag = ';unpack=false' if bundle_archive.endswith('.7z') else ''
sha_flag = f';sha256sum={bundle_sha}' if bundle_sha else ''
filename_flag = f';downloadfilename={bundle_archive}'
return f'{gcs_uri}{filename_flag}{unpack_flag}{sha_flag}'

bundle_dir = d.getVar('COMMERCIAL_BUNDLE_DIR')

if bundle_archive and not gcs_uri:
unpack_flag = ';unpack=false' if bundle_archive.endswith('.7z') else ''
return f'file://{bundle_dir}/{bundle_archive}{unpack_flag};sha256sum={bundle_sha}'

# Return dummy placeholder file when not configured
if placeholder:
return f'file://{placeholder}'
return ""

def get_commercial_source_dir(d):
"""Get source directory for commercial bundle if configured, WORKDIR otherwise"""
workdir = d.getVar('WORKDIR')
bundle_name = d.getVar('COMMERCIAL_BUNDLE_NAME')

# Check for direct source directory - return the copy location in WORKDIR
src_dir = d.getVar('COMMERCIAL_BUNDLE_SRC_DIR')
if src_dir and src_dir.strip() and not src_dir.startswith('${'):
# do_commercial_extract will copy to WORKDIR/bundle_name
if bundle_name and bundle_name.strip() and not bundle_name.startswith('${'):
return f'{workdir}/{bundle_name}'
# Fallback to workdir if bundle_name not set
return workdir

# Check if bundle_name is actually set (not empty, None, or unexpanded variable)
if bundle_name and bundle_name.strip() and not bundle_name.startswith('${'):
return f'{workdir}/{bundle_name}'
return workdir

def get_commercial_bbclassextend(d):
"""Return BBCLASSEXTEND variants only when commercial bundle is configured"""
bundle_name = d.getVar('COMMERCIAL_BUNDLE_NAME')

# Check if bundle_name is actually set (not empty, None, or unexpanded variable)
if bundle_name and bundle_name.strip() and not bundle_name.startswith('${'):
return 'native nativesdk'
return ''

# Generic variables for commercial bundle extraction
COMMERCIAL_BUNDLE_ENABLED ?= "0"
COMMERCIAL_BUNDLE_DIR ?= ""
COMMERCIAL_BUNDLE_NAME ?= ""
COMMERCIAL_BUNDLE_FILE ?= ""
COMMERCIAL_BUNDLE_PASS ?= ""
COMMERCIAL_BUNDLE_SHA ?= ""
COMMERCIAL_BUNDLE_TARGET ?= "${WORKDIR}"
COMMERCIAL_BUNDLE_PLACEHOLDER ?= "${WOLFSSL_LAYERDIR}/recipes-wolfssl/wolfssl/commercial/files/README.md"
COMMERCIAL_BUNDLE_GCS_URI ?= ""
COMMERCIAL_BUNDLE_SRC_DIR ?= ""
COMMERCIAL_BUNDLE_ARCHIVE = "${@get_commercial_bundle_archive(d)}"

# Auto-detect extracted directory name from WOLFSSL_VERSION if not explicitly set
# This handles cases where tarball name differs from extracted directory
WOLFSSL_SRC_SUBDIR ?= "${@'wolfssl-' + d.getVar('WOLFSSL_VERSION') if d.getVar('WOLFSSL_VERSION') else d.getVar('WOLFSSL_SRC') or ''}"

# Task to extract commercial bundle
python do_commercial_extract() {
import os
import bb
import bb.process
import bb.build

enabled = d.getVar('COMMERCIAL_BUNDLE_ENABLED')
src_dir = d.getVar('COMMERCIAL_BUNDLE_SRC_DIR')
bundle_dir = d.getVar('COMMERCIAL_BUNDLE_DIR')
bundle_archive = d.getVar('COMMERCIAL_BUNDLE_ARCHIVE')
bundle_pass = d.getVar('COMMERCIAL_BUNDLE_PASS')
target_dir = d.getVar('COMMERCIAL_BUNDLE_TARGET')
bundle_sha = d.getVar('COMMERCIAL_BUNDLE_SHA') or ''

if enabled != "1":
bb.note("COMMERCIAL_BUNDLE_ENABLED=0; skipping commercial extraction (standard fetch/unpack will run).")
return

# If direct source directory is provided, skip extraction
if src_dir and src_dir.strip() and not src_dir.startswith('${'):
bb.note(f"COMMERCIAL_BUNDLE_SRC_DIR={src_dir}; copying source directory to WORKDIR.")

# Copy source directory to WORKDIR to avoid polluting the original
import shutil
bundle_name = d.getVar('COMMERCIAL_BUNDLE_NAME')
dest_dir = os.path.join(target_dir, bundle_name)

if os.path.exists(dest_dir):
bb.note(f"Removing existing build directory: {dest_dir}")
shutil.rmtree(dest_dir)

bb.note(f"Copying {src_dir} to {dest_dir}")
shutil.copytree(src_dir, dest_dir, symlinks=True)
bb.note("Source directory copied successfully")
return

if not bundle_dir:
bb.fatal("COMMERCIAL_BUNDLE_DIR not set. Please set the directory containing the commercial bundle.")

if not bundle_archive:
bb.fatal("COMMERCIAL_BUNDLE_NAME/FILE not set. Please provide the bundle filename.")

is_seven_zip = bundle_archive.endswith('.7z')
is_tarball = bundle_archive.endswith('.tar.gz') or bundle_archive.endswith('.tgz')

if is_seven_zip and not bundle_pass:
bb.fatal("COMMERCIAL_BUNDLE_PASS not set. Please set bundle password for .7z archives.")

if not is_seven_zip:
bb.note("Non-7z commercial bundle detected; letting BitBake unpack the archive.")
return

bundle_path = os.path.join(bundle_dir, bundle_archive)

if not os.path.exists(bundle_path):
bb.fatal(f"Commercial bundle not found: {bundle_path}\n" +
"Please download the commercial bundle and place it in the appropriate directory.\n" +
"Contact support@wolfssl.com for access to commercial bundles.")

# Verify checksum locally (BitBake's file:// fetcher may skip it)
if bundle_sha:
import hashlib
h = hashlib.sha256()
with open(bundle_path, 'rb') as f:
for chunk in iter(lambda: f.read(1024 * 1024), b''):
h.update(chunk)
digest = h.hexdigest()
if digest != bundle_sha:
bb.fatal(f"SHA256 mismatch for {bundle_archive}:\n"
f" expected: {bundle_sha}\n"
f" actual: {digest}\n"
"Update WOLFSSL_SRC_SHA/COMMERCIAL_BUNDLE_SHA to the correct value.")

# Copy bundle to target directory
bb.plain(f"Extracting commercial bundle: {bundle_archive}")
ret = os.system(f'cp -f "{bundle_path}" "{target_dir}"')
if ret != 0:
bb.fatal(f"Failed to copy bundle to {target_dir}")

archive_in_target = os.path.join(target_dir, bundle_archive)

if is_seven_zip:
# Locate 7zip binary from native sysroot or host
path = d.getVar('PATH')
seven_zip = bb.utils.which(path, '7za') or bb.utils.which(path, '7z')

if not seven_zip:
bb.fatal("Failed to find either '7za' or '7z' in PATH.\n"
"Ensure p7zip-native is available or install p7zip on the build host.")

cmd = [seven_zip, 'x', archive_in_target, f"-p{bundle_pass}",
f"-o{target_dir}", '-aoa']
else:
bb.fatal(f"Unsupported commercial bundle format: {bundle_archive}. Expected .7z.")

try:
bb.process.run(cmd)
except bb.process.ExecutionError as exc:
bb.fatal("Failed to extract bundle. Check credentials and bundle integrity.\n" + str(exc))

bb.plain("Commercial bundle extracted successfully")
}

# Add task after fetch, before patch (place before do_patch so it still runs even if do_unpack is skipped)
addtask commercial_extract after do_fetch before do_patch

# Conditionally add p7zip-native dependency only when commercial bundle variables are set
python __anonymous() {
enabled = d.getVar('COMMERCIAL_BUNDLE_ENABLED')
if not enabled or enabled == '0':
wolfssl_src = d.getVar('WOLFSSL_SRC')
wolfssl_src_dir = d.getVar('COMMERCIAL_BUNDLE_SRC_DIR')

if (wolfssl_src and wolfssl_src.strip()) or (wolfssl_src_dir and wolfssl_src_dir.strip() and not wolfssl_src_dir.startswith('${')):
d.setVar('COMMERCIAL_BUNDLE_ENABLED', '1')
enabled = '1'
bb.debug(1, "COMMERCIAL_BUNDLE_ENABLED auto-detected as 1 based on WOLFSSL_SRC or COMMERCIAL_BUNDLE_SRC_DIR")

src_dir = d.getVar('COMMERCIAL_BUNDLE_SRC_DIR')
archive = d.getVar('COMMERCIAL_BUNDLE_ARCHIVE')

# Skip p7zip and unpack tasks if using direct source directory
# But keep commercial_extract to copy the source
if enabled == "1" and src_dir and src_dir.strip() and not src_dir.startswith('${'):
bb.build.deltask('do_fetch', d)
bb.build.deltask('do_unpack', d)
# do_commercial_extract will copy the source directory
return

if enabled == "1" and archive and archive.endswith('.7z'):
d.appendVar('DEPENDS', ' p7zip-native')
d.appendVarFlag('do_commercial_extract', 'depends', ' p7zip-native:do_populate_sysroot')
# Older BitBake releases sometimes ignore 'unpack=false' on file:// URLs,
# causing do_unpack to run with no password and wipe the extracted tree.
# When we manage a passworded .7z ourselves, skip do_unpack entirely.
bb.build.deltask('do_unpack', d)

# Commercial bundles ship preconfigured scripts; drop libtool sysroot flag
opts = d.getVar('CONFIGUREOPTS') or ''
import shlex
tokens = shlex.split(opts)
tokens = [t for t in tokens if not t.startswith('--with-libtool-sysroot=')]
d.setVar('CONFIGUREOPTS', ' '.join(tokens))
d.setVar('CONFIGUREOPT_SYSROOT', '')
}

# Skip autoreconf for commercial bundles and rely on bundled configure script
do_configure() {
bbnote "Commercial bundle detected, skipping autoreconf and running bundled configure"
# Ensure libtool sysroot option is stripped (not accepted by commercial bundles)
unset CONFIGUREOPT_SYSROOT
CONFIGUREOPTS="$(echo ${CONFIGUREOPTS} | sed 's/--with-libtool-sysroot=[^ ]*//g')"
if [ -e "${S}/configure.ac" ] && [ ! -f "${S}/stamp-h.in" ] && \
grep -q "AC_CONFIG_FILES(\\[stamp-h\\]" "${S}/configure.ac"; then
bbnote "stamp-h.in missing; generating stub for preconfigured commercial source"
echo "timestamp" > "${S}/stamp-h.in"
fi
if [ -e "${CONFIGURE_SCRIPT}" ]; then
oe_runconf
else
bbfatal "configure script not found at ${CONFIGURE_SCRIPT}"
fi
}

# Task to create stub autogen.sh for commercial bundles
do_commercial_stub_autogen() {
if [ "${COMMERCIAL_BUNDLE_ENABLED}" != "1" ]; then
bbnote "Commercial bundle disabled; skipping autogen stub."
exit 0
fi

if [ ! -d "${S}" ]; then
bbwarn "Source directory ${S} missing before autogen stub; skipping."
exit 0
fi

# Commercial bundles are pre-configured and don't need autogen.sh
# Create a no-op autogen.sh to prevent automatic execution
if [ ! -f ${S}/autogen.sh ]; then
echo '#!/bin/sh' > ${S}/autogen.sh
echo '# Commercial bundle - pre-configured, no autogen needed' >> ${S}/autogen.sh
echo 'exit 0' >> ${S}/autogen.sh
chmod +x ${S}/autogen.sh
bbplain "Created stub autogen.sh for commercial bundle"
else
bbplain "Replacing existing autogen.sh with stub for commercial bundle"
echo '#!/bin/sh' > ${S}/autogen.sh
echo '# Commercial bundle - pre-configured, no autogen needed' >> ${S}/autogen.sh
echo 'exit 0' >> ${S}/autogen.sh
chmod +x ${S}/autogen.sh
fi
}

# Add task after unpack (or commercial_extract for 7z), before configure
addtask commercial_stub_autogen after do_unpack before do_configure
Loading