Skip to content

Commit 843922c

Browse files
committed
sbom: add --dep-openssl for OpenSSL-compat products
Add an openssl entry to DEP_META (Apache-2.0, OpenSSL 3.x git-tag purl) and a --dep-openssl flag so OpenSSL-compat products (wolfProvider, wolfEngine) can record OpenSSL as a dependency component alongside wolfSSL. Update tests. Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
1 parent a260aec commit 843922c

2 files changed

Lines changed: 40 additions & 3 deletions

File tree

scripts/gen-sbom

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ DEP_META = {
145145
# vendor:product mapping a pkg:generic PURL would force.
146146
'purl': lambda v: f'pkg:github/madler/zlib@{v}',
147147
},
148+
# openssl, declared as a dependency by the OpenSSL-compat products
149+
# (wolfProvider, wolfEngine) that link libcrypto/libssl alongside wolfSSL.
150+
# Only emitted when the caller passes --dep-openssl yes. These products
151+
# target the OpenSSL 3.x provider/engine ABI, which is Apache-2.0 (older
152+
# 1.1.x was the SPDX "OpenSSL" licence); Apache-2.0 is therefore the correct
153+
# id for the supported surface. The purl uses OpenSSL 3.x's "openssl-X.Y.Z"
154+
# git tag form so it resolves in OSV / GHSA.
155+
'openssl': {
156+
'name': 'openssl',
157+
'supplier': 'OpenSSL Software Foundation',
158+
'license': 'Apache-2.0',
159+
'download': 'https://github.com/openssl/openssl',
160+
'pkgconfig': 'openssl',
161+
'purl': lambda v: f'pkg:github/openssl/openssl@openssl-{v}',
162+
},
148163
}
149164

150165

@@ -1162,6 +1177,12 @@ def main():
11621177
'wolfSSL\'s own SBOM leaves this off. Combine '
11631178
'with --dep-version wolfssl=X.Y.Z on hosts '
11641179
'without wolfssl.pc.')
1180+
parser.add_argument('--dep-openssl', default='no',
1181+
help='yes to record openssl as a dependency component '
1182+
'(for OpenSSL-compat products such as wolfProvider '
1183+
'/ wolfEngine that link libcrypto/libssl). Combine '
1184+
'with --dep-version openssl=X.Y.Z on hosts without '
1185+
'openssl.pc.')
11651186
parser.add_argument('--dep-libz', default='no',
11661187
help='yes if built with --with-libz')
11671188
parser.add_argument('--dep-liboqs', default='no',
@@ -1234,6 +1255,7 @@ def main():
12341255
enabled_deps = [
12351256
key for key, flag in [
12361257
('wolfssl', args.dep_wolfssl),
1258+
('openssl', args.dep_openssl),
12371259
('libz', args.dep_libz),
12381260
('liboqs', args.dep_liboqs),
12391261
]

scripts/test_gen_sbom.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,11 @@ class TestDepMetaShape(unittest.TestCase):
828828

829829
def test_only_expected_deps_are_tracked(self):
830830
# wolfssl is tracked so downstream wolfSSL-stack products (wolfSSH,
831-
# wolfMQTT, ...) can declare it via --dep-wolfssl; libz/liboqs are
832-
# wolfSSL's own optional linked deps.
831+
# wolfMQTT, ...) can declare it via --dep-wolfssl; openssl so the
832+
# OpenSSL-compat products (wolfProvider, wolfEngine) can declare it via
833+
# --dep-openssl; libz/liboqs are wolfSSL's own optional linked deps.
833834
self.assertEqual(set(gs.DEP_META.keys()),
834-
{'wolfssl', 'libz', 'liboqs'})
835+
{'wolfssl', 'openssl', 'libz', 'liboqs'})
835836

836837
def test_wolfssl_dep_entry_describes_the_linked_artefact(self):
837838
wolfssl = gs.DEP_META['wolfssl']
@@ -847,6 +848,19 @@ def test_wolfssl_dep_entry_describes_the_linked_artefact(self):
847848
wolfssl['purl']('5.7.4'),
848849
'pkg:github/wolfSSL/wolfssl@v5.7.4')
849850

851+
def test_openssl_dep_entry_describes_the_linked_artefact(self):
852+
openssl = gs.DEP_META['openssl']
853+
self.assertEqual(openssl['name'], 'openssl')
854+
self.assertEqual(openssl['supplier'], 'OpenSSL Software Foundation')
855+
self.assertEqual(openssl['pkgconfig'], 'openssl')
856+
# wolfProvider / wolfEngine target the OpenSSL 3.x provider/engine ABI,
857+
# which is Apache-2.0. The purl uses OpenSSL 3.x's "openssl-X.Y.Z" git
858+
# tag form so it resolves in OSV / GHSA.
859+
self.assertEqual(openssl['license'], 'Apache-2.0')
860+
self.assertEqual(
861+
openssl['purl']('3.5.0'),
862+
'pkg:github/openssl/openssl@openssl-3.5.0')
863+
850864
def test_liboqs_entry_describes_the_linked_artefact(self):
851865
liboqs = gs.DEP_META['liboqs']
852866
self.assertEqual(liboqs['name'], 'liboqs')
@@ -887,6 +901,7 @@ def test_dep_liboqs_is_accepted(self):
887901
self.assertIn('--dep-liboqs', result.stdout)
888902
self.assertIn('--dep-libz', result.stdout)
889903
self.assertIn('--dep-wolfssl', result.stdout)
904+
self.assertIn('--dep-openssl', result.stdout)
890905

891906
def test_removed_flags_are_rejected(self):
892907
# Each of these was either renamed (--dep-falcon -> --dep-liboqs)

0 commit comments

Comments
 (0)