feat(yocto): read what a build installed from its SPDX 2.2 (#150) #852
No files matched your search
Generated
+1
@@ -639,6 +639,7 @@ dependencies = [
|
||||
"werkbank-exec",
|
||||
"yaml-rust2",
|
||||
"zip",
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -62,6 +62,8 @@ urlencoding = "2"
|
||||
futures-util = "0.3"
|
||||
zip = { workspace = true }
|
||||
tar = { workspace = true }
|
||||
# Yocto image SPDX archives (`*.spdx.tar.zst`); already in the tree via zip.
|
||||
zstd = "0.14"
|
||||
flate2 = { workspace = true }
|
||||
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-webpki-roots"] }
|
||||
dashmap = { workspace = true }
|
||||
|
||||
@@ -56,3 +56,4 @@ pub mod vendor;
|
||||
pub mod vex_lifecycle;
|
||||
pub mod yocto_inventory;
|
||||
pub mod yocto_pins;
|
||||
pub mod yocto_spdx;
|
||||
@@ -0,0 +1,612 @@
|
||||
//! What a Yocto build put into an image, read from the build's own SPDX 2.2.
|
||||
//!
|
||||
//! Yocto's `create-spdx` class (the default since kirkstone; scarthgap writes
|
||||
//! SPDX 2.2) archives one document per image, binary package, recipe and
|
||||
//! runtime set into `<image>.spdx.tar.zst` next to the image. The image
|
||||
//! document `CONTAINS` the packages that are installed, each package is
|
||||
//! `GENERATED_FROM` its recipe, and the documents point at each other through
|
||||
//! `externalDocumentRefs` by namespace. Unlike the recipe inventory
|
||||
//! ([`crate::pipeline::yocto_inventory`]), which reads the recipes as written,
|
||||
//! this is what the build resolved: overrides, PACKAGECONFIG and the machine
|
||||
//! applied, only what is in the image.
|
||||
//!
|
||||
//! [`read_archive`] (or [`read_dir`] for an extracted archive) returns one
|
||||
//! [`BuiltImage`] per image document: an SBOM component per recipe with
|
||||
//! packages in the image (recipe version, declared licence, the CPEs NVD
|
||||
//! knows it by), marked [`InImageBasis::Built`], and the CVEs the recipe's
|
||||
//! patches fix (`sourceInfo: "CVEs fixed: …"`), which settle those CVEs as
|
||||
//! fixed. References that cannot be resolved are listed, not guessed.
|
||||
|
||||
use std::collections::{BTreeMap, BTreeSet, HashMap};
|
||||
use std::io::Read;
|
||||
use std::path::Path;
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
use compliance_core::models::{InImage, InImageBasis, SbomEntry, YOCTO_RECIPE_MANAGER};
|
||||
use compliance_core::purl::encode;
|
||||
|
||||
/// Where a component read from the build's SPDX comes from, on its evidence.
|
||||
pub const SOURCE: &str = "Yocto build SPDX";
|
||||
|
||||
/// Limits on an uploaded archive: it is untrusted input.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct ReadLimits {
|
||||
/// Documents read at most.
|
||||
pub max_documents: usize,
|
||||
/// Bytes one document may have once decompressed.
|
||||
pub max_document_bytes: u64,
|
||||
/// Bytes all documents may have together once decompressed.
|
||||
pub max_total_bytes: u64,
|
||||
}
|
||||
|
||||
impl Default for ReadLimits {
|
||||
fn default() -> Self {
|
||||
// A core-image-minimal archive holds ~380 documents and ~11 MB; a
|
||||
// large product image a few thousand.
|
||||
Self {
|
||||
max_documents: 20_000,
|
||||
max_document_bytes: 64 * 1024 * 1024,
|
||||
max_total_bytes: 1024 * 1024 * 1024,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Why the build's SPDX could not be read.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum YoctoSpdxError {
|
||||
#[error("cannot read the SPDX archive: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
#[error("the SPDX archive exceeds its limits: {0}")]
|
||||
TooLarge(&'static str),
|
||||
#[error("{file} is not an SPDX 2.2 JSON document: {reason}")]
|
||||
NotSpdx { file: String, reason: String },
|
||||
#[error("no image document (an SPDX package `SPDXRef-Image-…`) in the archive")]
|
||||
NoImage,
|
||||
}
|
||||
|
||||
/// One image as the build made it.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct BuiltImage {
|
||||
/// The image recipe (`core-image-minimal`).
|
||||
pub image: String,
|
||||
/// The image document's package id, which carries the machine and build
|
||||
/// time (`SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-…`).
|
||||
pub image_id: String,
|
||||
/// One component per recipe with packages in the image, sorted by name.
|
||||
pub entries: Vec<SbomEntry>,
|
||||
/// The CVEs the recipes' patches fix, per component, sorted.
|
||||
pub fixed: Vec<FixedCve>,
|
||||
/// Packages the image contains whose documents are not in the archive,
|
||||
/// or whose recipe is not (`missing-pkg`), sorted.
|
||||
pub unresolved: Vec<String>,
|
||||
}
|
||||
|
||||
/// A CVE a recipe's patch fixes in the component built from it.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct FixedCve {
|
||||
pub component: String,
|
||||
pub version: String,
|
||||
pub cve: String,
|
||||
}
|
||||
|
||||
/// Read the images of a `<image>.spdx.tar.zst` archive.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// The archive cannot be read, exceeds `limits`, holds a document that is
|
||||
/// not SPDX JSON, or holds no image document.
|
||||
pub fn read_archive(
|
||||
archive: &Path,
|
||||
repo_id: &str,
|
||||
limits: ReadLimits,
|
||||
) -> Result<Vec<BuiltImage>, YoctoSpdxError> {
|
||||
let file = std::fs::File::open(archive)?;
|
||||
let decoder = zstd::stream::read::Decoder::new(file)?;
|
||||
let mut tar = tar::Archive::new(decoder);
|
||||
let mut documents = Vec::new();
|
||||
let mut total = 0u64;
|
||||
for entry in tar.entries()? {
|
||||
let entry = entry?;
|
||||
if !entry.header().entry_type().is_file() {
|
||||
continue;
|
||||
}
|
||||
let name = entry.path()?.to_string_lossy().into_owned();
|
||||
if !name.ends_with(".spdx.json") {
|
||||
continue;
|
||||
}
|
||||
if documents.len() >= limits.max_documents {
|
||||
return Err(YoctoSpdxError::TooLarge("too many documents"));
|
||||
}
|
||||
// `take` caps what is read whatever the header claims.
|
||||
let mut bytes = Vec::new();
|
||||
entry
|
||||
.take(limits.max_document_bytes + 1)
|
||||
.read_to_end(&mut bytes)?;
|
||||
if bytes.len() as u64 > limits.max_document_bytes {
|
||||
return Err(YoctoSpdxError::TooLarge("a document is too large"));
|
||||
}
|
||||
total += bytes.len() as u64;
|
||||
if total > limits.max_total_bytes {
|
||||
return Err(YoctoSpdxError::TooLarge(
|
||||
"the documents are too large together",
|
||||
));
|
||||
}
|
||||
documents.push((name, bytes));
|
||||
}
|
||||
images(&parse(documents)?, repo_id)
|
||||
}
|
||||
|
||||
/// Read the images of an extracted archive: every `*.spdx.json` directly in
|
||||
/// `dir`.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// As [`read_archive`].
|
||||
pub fn read_dir(
|
||||
dir: &Path,
|
||||
repo_id: &str,
|
||||
limits: ReadLimits,
|
||||
) -> Result<Vec<BuiltImage>, YoctoSpdxError> {
|
||||
let mut documents = Vec::new();
|
||||
let mut total = 0u64;
|
||||
let mut paths: Vec<_> = std::fs::read_dir(dir)?
|
||||
.filter_map(Result::ok)
|
||||
.map(|e| e.path())
|
||||
.filter(|p| p.is_file() && p.to_string_lossy().ends_with(".spdx.json"))
|
||||
.collect();
|
||||
paths.sort();
|
||||
if paths.len() > limits.max_documents {
|
||||
return Err(YoctoSpdxError::TooLarge("too many documents"));
|
||||
}
|
||||
for path in paths {
|
||||
let size = std::fs::metadata(&path)?.len();
|
||||
if size > limits.max_document_bytes {
|
||||
return Err(YoctoSpdxError::TooLarge("a document is too large"));
|
||||
}
|
||||
total += size;
|
||||
if total > limits.max_total_bytes {
|
||||
return Err(YoctoSpdxError::TooLarge(
|
||||
"the documents are too large together",
|
||||
));
|
||||
}
|
||||
let name = path
|
||||
.file_name()
|
||||
.map(|n| n.to_string_lossy().into_owned())
|
||||
.unwrap_or_default();
|
||||
documents.push((name, std::fs::read(&path)?));
|
||||
}
|
||||
images(&parse(documents)?, repo_id)
|
||||
}
|
||||
|
||||
/// An SPDX 2.2 document, as far as it is read here.
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Document {
|
||||
#[serde(rename = "documentNamespace")]
|
||||
namespace: String,
|
||||
#[serde(default)]
|
||||
packages: Vec<Package>,
|
||||
#[serde(default)]
|
||||
relationships: Vec<Relationship>,
|
||||
#[serde(default, rename = "externalDocumentRefs")]
|
||||
external: Vec<ExternalRef>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Package {
|
||||
#[serde(rename = "SPDXID")]
|
||||
id: String,
|
||||
name: String,
|
||||
#[serde(default, rename = "versionInfo")]
|
||||
version: Option<String>,
|
||||
#[serde(default, rename = "licenseDeclared")]
|
||||
license: Option<String>,
|
||||
#[serde(default, rename = "externalRefs")]
|
||||
refs: Vec<PackageRef>,
|
||||
#[serde(default, rename = "sourceInfo")]
|
||||
source_info: Option<String>,
|
||||
#[serde(default)]
|
||||
homepage: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct PackageRef {
|
||||
#[serde(rename = "referenceType")]
|
||||
kind: String,
|
||||
#[serde(rename = "referenceLocator")]
|
||||
locator: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Relationship {
|
||||
#[serde(rename = "spdxElementId")]
|
||||
from: String,
|
||||
#[serde(rename = "relationshipType")]
|
||||
kind: String,
|
||||
#[serde(rename = "relatedSpdxElement")]
|
||||
to: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct ExternalRef {
|
||||
#[serde(rename = "externalDocumentId")]
|
||||
id: String,
|
||||
#[serde(rename = "spdxDocument")]
|
||||
namespace: String,
|
||||
}
|
||||
|
||||
/// The documents by namespace.
|
||||
fn parse(documents: Vec<(String, Vec<u8>)>) -> Result<HashMap<String, Document>, YoctoSpdxError> {
|
||||
let mut by_namespace = HashMap::with_capacity(documents.len());
|
||||
for (file, bytes) in documents {
|
||||
let doc: Document =
|
||||
serde_json::from_slice(&bytes).map_err(|e| YoctoSpdxError::NotSpdx {
|
||||
file: file.clone(),
|
||||
reason: e.to_string(),
|
||||
})?;
|
||||
by_namespace.insert(doc.namespace.clone(), doc);
|
||||
}
|
||||
Ok(by_namespace)
|
||||
}
|
||||
|
||||
/// The package `local` of the document `doc` refers to as `reference`
|
||||
/// (`DocumentRef-busybox:SPDXRef-Package-busybox`), with its document.
|
||||
fn resolve<'a>(
|
||||
docs: &'a HashMap<String, Document>,
|
||||
doc: &Document,
|
||||
reference: &str,
|
||||
) -> Option<(&'a Document, &'a Package)> {
|
||||
let (doc_ref, local) = reference.split_once(':')?;
|
||||
let namespace = &doc.external.iter().find(|e| e.id == doc_ref)?.namespace;
|
||||
let target = docs.get(namespace)?;
|
||||
let package = target.packages.iter().find(|p| p.id == local)?;
|
||||
Some((target, package))
|
||||
}
|
||||
|
||||
/// Every image of `docs`.
|
||||
fn images(
|
||||
docs: &HashMap<String, Document>,
|
||||
repo_id: &str,
|
||||
) -> Result<Vec<BuiltImage>, YoctoSpdxError> {
|
||||
let mut out = Vec::new();
|
||||
for doc in docs.values() {
|
||||
for image in doc
|
||||
.packages
|
||||
.iter()
|
||||
.filter(|p| p.id.starts_with("SPDXRef-Image-"))
|
||||
{
|
||||
out.push(built_image(docs, doc, image, repo_id));
|
||||
}
|
||||
}
|
||||
if out.is_empty() {
|
||||
return Err(YoctoSpdxError::NoImage);
|
||||
}
|
||||
out.sort_by(|a, b| a.image_id.cmp(&b.image_id));
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// A recipe with packages in the image, and those packages.
|
||||
struct RecipeInImage<'a> {
|
||||
recipe: &'a Package,
|
||||
packages: BTreeSet<&'a str>,
|
||||
}
|
||||
|
||||
/// The image `image` of the document `doc`.
|
||||
fn built_image(
|
||||
docs: &HashMap<String, Document>,
|
||||
doc: &Document,
|
||||
image: &Package,
|
||||
repo_id: &str,
|
||||
) -> BuiltImage {
|
||||
let mut recipes: BTreeMap<(String, String), RecipeInImage<'_>> = BTreeMap::new();
|
||||
let mut unresolved = BTreeSet::new();
|
||||
let contained = doc
|
||||
.relationships
|
||||
.iter()
|
||||
.filter(|r| r.from == image.id && r.kind == "CONTAINS");
|
||||
for rel in contained {
|
||||
let Some((package_doc, package)) = resolve(docs, doc, &rel.to) else {
|
||||
unresolved.insert(package_name(&rel.to));
|
||||
continue;
|
||||
};
|
||||
let recipe = package_doc
|
||||
.relationships
|
||||
.iter()
|
||||
.filter(|r| r.from == package.id && r.kind == "GENERATED_FROM")
|
||||
.find_map(|r| resolve(docs, package_doc, &r.to))
|
||||
.map(|(_, recipe)| recipe)
|
||||
.filter(|recipe| recipe.id.starts_with("SPDXRef-Recipe-"));
|
||||
let Some(recipe) = recipe else {
|
||||
unresolved.insert(package.name.clone());
|
||||
continue;
|
||||
};
|
||||
let version = recipe
|
||||
.version
|
||||
.clone()
|
||||
.or_else(|| package.version.clone())
|
||||
.unwrap_or_default();
|
||||
recipes
|
||||
.entry((recipe.name.clone(), version))
|
||||
.or_insert_with(|| RecipeInImage {
|
||||
recipe,
|
||||
packages: BTreeSet::new(),
|
||||
})
|
||||
.packages
|
||||
.insert(package.name.as_str());
|
||||
}
|
||||
|
||||
let mut entries = Vec::with_capacity(recipes.len());
|
||||
let mut fixed = Vec::new();
|
||||
for ((name, version), found) in &recipes {
|
||||
entries.push(entry(name, version, found, &image.name, &image.id, repo_id));
|
||||
fixed.extend(fixed_cves(found.recipe).into_iter().map(|cve| FixedCve {
|
||||
component: name.clone(),
|
||||
version: version.clone(),
|
||||
cve,
|
||||
}));
|
||||
}
|
||||
fixed.sort();
|
||||
BuiltImage {
|
||||
image: image.name.clone(),
|
||||
image_id: image.id.clone(),
|
||||
entries,
|
||||
fixed,
|
||||
unresolved: unresolved.into_iter().collect(),
|
||||
}
|
||||
}
|
||||
|
||||
/// The SBOM component of one recipe in the image.
|
||||
fn entry(
|
||||
name: &str,
|
||||
version: &str,
|
||||
found: &RecipeInImage<'_>,
|
||||
image: &str,
|
||||
image_id: &str,
|
||||
repo_id: &str,
|
||||
) -> SbomEntry {
|
||||
let recipe = found.recipe;
|
||||
let mut entry = SbomEntry::new(
|
||||
repo_id.to_string(),
|
||||
name.to_string(),
|
||||
version.to_string(),
|
||||
YOCTO_RECIPE_MANAGER.to_string(),
|
||||
);
|
||||
entry.purl = Some(if version.is_empty() {
|
||||
format!("pkg:generic/{}", encode(name))
|
||||
} else {
|
||||
format!("pkg:generic/{}@{}", encode(name), encode(version))
|
||||
});
|
||||
entry.license = recipe.license.as_deref().and_then(license);
|
||||
entry.cpe = cpes(recipe).into_iter().next();
|
||||
entry.manufacturer_url = recipe
|
||||
.homepage
|
||||
.clone()
|
||||
.filter(|h| h.starts_with("https://") || h.starts_with("http://"));
|
||||
let packages: Vec<&str> = found.packages.iter().copied().collect();
|
||||
entry.evidence.push(format!(
|
||||
"{SOURCE} ({}): packages {}",
|
||||
image_id.trim_start_matches("SPDXRef-Image-"),
|
||||
packages.join(", ")
|
||||
));
|
||||
let in_image = InImage {
|
||||
basis: InImageBasis::Built,
|
||||
images: vec![image.to_string()],
|
||||
};
|
||||
entry.evidence.push(in_image.describe());
|
||||
entry.in_image = Some(in_image);
|
||||
entry
|
||||
}
|
||||
|
||||
/// The package name of an unresolved reference
|
||||
/// (`DocumentRef-x:SPDXRef-Package-busybox` → `busybox`).
|
||||
fn package_name(reference: &str) -> String {
|
||||
let local = reference.split_once(':').map_or(reference, |(_, l)| l);
|
||||
local
|
||||
.strip_prefix("SPDXRef-Package-")
|
||||
.unwrap_or(local)
|
||||
.to_string()
|
||||
}
|
||||
|
||||
/// A declared licence as an SPDX expression, without the document prefix of
|
||||
/// a licence defined in another document (`DocumentRef-recipe-busybox:
|
||||
/// LicenseRef-bzip2-1.0.4` → `LicenseRef-bzip2-1.0.4`); `None` for
|
||||
/// NOASSERTION, NONE or nothing.
|
||||
fn license(declared: &str) -> Option<String> {
|
||||
let cleaned: Vec<String> = declared
|
||||
.split_whitespace()
|
||||
.map(|token| {
|
||||
let (open, rest) = token.split_at(token.len() - token.trim_start_matches('(').len());
|
||||
let inner = rest.trim_end_matches(')');
|
||||
let close = &rest[inner.len()..];
|
||||
let inner = match inner.split_once(':') {
|
||||
Some((doc, id)) if doc.starts_with("DocumentRef-") => id,
|
||||
_ => inner,
|
||||
};
|
||||
format!("{open}{inner}{close}")
|
||||
})
|
||||
.collect();
|
||||
let expression = cleaned.join(" ");
|
||||
match expression.as_str() {
|
||||
"" | "NOASSERTION" | "NONE" => None,
|
||||
_ => Some(expression),
|
||||
}
|
||||
}
|
||||
|
||||
/// The CPE 2.3 names a recipe is known by (CVE_PRODUCT), in order.
|
||||
fn cpes(recipe: &Package) -> Vec<String> {
|
||||
recipe
|
||||
.refs
|
||||
.iter()
|
||||
.filter(|r| r.kind.ends_with("cpe23Type"))
|
||||
.map(|r| r.locator.clone())
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The CVEs a recipe's patches fix: create-spdx writes them into the
|
||||
/// recipe's `sourceInfo` as `CVEs fixed: CVE-… CVE-…`.
|
||||
fn fixed_cves(recipe: &Package) -> Vec<String> {
|
||||
let Some(rest) = recipe
|
||||
.source_info
|
||||
.as_deref()
|
||||
.and_then(|s| s.split_once("CVEs fixed:"))
|
||||
.map(|(_, rest)| rest)
|
||||
else {
|
||||
return Vec::new();
|
||||
};
|
||||
let mut cves: Vec<String> = rest
|
||||
.split(|c: char| c.is_whitespace() || c == ',')
|
||||
.filter(|t| t.starts_with("CVE-") && t.len() > 4)
|
||||
.map(str::to_string)
|
||||
.collect();
|
||||
cves.sort();
|
||||
cves.dedup();
|
||||
cves
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::expect_used, clippy::unwrap_used)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// A trimmed copy of a real scarthgap (5.0.21) core-image-minimal for
|
||||
/// qemuarm64: four recipes and one package whose document is missing.
|
||||
fn fixtures() -> PathBuf {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../fixtures/yocto")
|
||||
}
|
||||
|
||||
fn check(images: &[BuiltImage]) {
|
||||
assert_eq!(images.len(), 1);
|
||||
let image = &images[0];
|
||||
assert_eq!(image.image, "core-image-minimal");
|
||||
assert!(image.image_id.contains("qemuarm64"), "{}", image.image_id);
|
||||
|
||||
let names: Vec<(&str, &str)> = image
|
||||
.entries
|
||||
.iter()
|
||||
.map(|e| (e.name.as_str(), e.version.as_str()))
|
||||
.collect();
|
||||
assert_eq!(
|
||||
names,
|
||||
[
|
||||
("base-files", "3.0.14"),
|
||||
("busybox", "1.36.1"),
|
||||
("openssl", "3.5.9"),
|
||||
("packagegroup-core-boot", "1.0"),
|
||||
]
|
||||
);
|
||||
|
||||
let busybox = &image.entries[1];
|
||||
assert_eq!(busybox.package_manager, YOCTO_RECIPE_MANAGER);
|
||||
assert_eq!(busybox.purl.as_deref(), Some("pkg:generic/busybox@1.36.1"));
|
||||
assert_eq!(
|
||||
busybox.license.as_deref(),
|
||||
Some("GPL-2.0-only AND LicenseRef-bzip2-1.0.4")
|
||||
);
|
||||
assert_eq!(
|
||||
busybox.cpe.as_deref(),
|
||||
Some("cpe:2.3:*:*:busybox:1.36.1:*:*:*:*:*:*:*")
|
||||
);
|
||||
let in_image = busybox.in_image.as_ref().expect("in the image");
|
||||
assert_eq!(in_image.basis, InImageBasis::Built);
|
||||
assert_eq!(in_image.images, ["core-image-minimal"]);
|
||||
// Its three packages are one component.
|
||||
assert!(
|
||||
busybox.evidence[0].ends_with("packages busybox, busybox-syslog, busybox-udhcpc"),
|
||||
"{:?}",
|
||||
busybox.evidence
|
||||
);
|
||||
|
||||
let openssl = &image.entries[2];
|
||||
assert_eq!(
|
||||
openssl.cpe.as_deref(),
|
||||
Some("cpe:2.3:*:openssl:openssl:3.5.9:*:*:*:*:*:*:*")
|
||||
);
|
||||
// A package group has no CPE: NVD knows nothing by that name.
|
||||
assert_eq!(image.entries[3].cpe, None);
|
||||
|
||||
let busybox_fixed: Vec<&str> = image
|
||||
.fixed
|
||||
.iter()
|
||||
.filter(|f| f.component == "busybox")
|
||||
.map(|f| f.cve.as_str())
|
||||
.collect();
|
||||
assert_eq!(busybox_fixed.len(), 15);
|
||||
assert!(busybox_fixed.contains(&"CVE-2022-48174"));
|
||||
assert!(busybox_fixed.windows(2).all(|w| w[0] < w[1]), "sorted");
|
||||
|
||||
assert_eq!(image.unresolved, ["missing-pkg"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_extracted_archive_lists_what_the_build_installed() {
|
||||
let images = read_dir(
|
||||
&fixtures().join("spdx-scarthgap"),
|
||||
"t",
|
||||
ReadLimits::default(),
|
||||
)
|
||||
.unwrap();
|
||||
check(&images);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_image_archive_reads_the_same() {
|
||||
let images = read_archive(
|
||||
&fixtures().join("core-image-minimal-qemuarm64.rootfs.spdx.tar.zst"),
|
||||
"t",
|
||||
ReadLimits::default(),
|
||||
)
|
||||
.unwrap();
|
||||
check(&images);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_archive_past_its_limits_is_refused() {
|
||||
let archive = fixtures().join("core-image-minimal-qemuarm64.rootfs.spdx.tar.zst");
|
||||
let few = ReadLimits {
|
||||
max_documents: 3,
|
||||
..ReadLimits::default()
|
||||
};
|
||||
assert!(matches!(
|
||||
read_archive(&archive, "t", few),
|
||||
Err(YoctoSpdxError::TooLarge(_))
|
||||
));
|
||||
let small = ReadLimits {
|
||||
max_document_bytes: 100,
|
||||
..ReadLimits::default()
|
||||
};
|
||||
assert!(matches!(
|
||||
read_archive(&archive, "t", small),
|
||||
Err(YoctoSpdxError::TooLarge(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn documents_without_an_image_or_not_spdx_are_refused() {
|
||||
let docs = vec![(
|
||||
"recipe-x.spdx.json".to_string(),
|
||||
br#"{"documentNamespace": "urn:x", "packages": [{"SPDXID": "SPDXRef-Recipe-x", "name": "x"}]}"#.to_vec(),
|
||||
)];
|
||||
assert!(matches!(
|
||||
images(&parse(docs).unwrap(), "t"),
|
||||
Err(YoctoSpdxError::NoImage)
|
||||
));
|
||||
let broken = vec![("a.spdx.json".to_string(), b"{".to_vec())];
|
||||
assert!(matches!(parse(broken), Err(YoctoSpdxError::NotSpdx { .. })));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn licences_lose_the_document_prefix_and_noassertion_is_none() {
|
||||
assert_eq!(
|
||||
license("GPL-2.0-only AND DocumentRef-recipe-busybox:LicenseRef-bzip2-1.0.4")
|
||||
.as_deref(),
|
||||
Some("GPL-2.0-only AND LicenseRef-bzip2-1.0.4")
|
||||
);
|
||||
assert_eq!(
|
||||
license("(MIT OR DocumentRef-r:LicenseRef-x)").as_deref(),
|
||||
Some("(MIT OR LicenseRef-x)")
|
||||
);
|
||||
assert_eq!(license("NOASSERTION"), None);
|
||||
assert_eq!(license(" "), None);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,9 @@ pub enum InImageBasis {
|
||||
/// read from the recipes without BitBake: what the image declares, not
|
||||
/// what a build resolved.
|
||||
Declared,
|
||||
/// The build's own SPDX lists one of its packages in the image (Yocto's
|
||||
/// create-spdx): what the build installed.
|
||||
Built,
|
||||
}
|
||||
|
||||
impl InImageBasis {
|
||||
@@ -48,6 +51,7 @@ impl InImageBasis {
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Declared => "declared",
|
||||
Self::Built => "built",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +59,7 @@ impl InImageBasis {
|
||||
pub fn describe(self) -> &'static str {
|
||||
match self {
|
||||
Self::Declared => "In the image (declared in the recipes, not resolved by bitbake)",
|
||||
Self::Built => "In the image (installed by the build, from its SPDX)",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T22:48:52Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/base-files-ee9424e3-1d7e-5739-b9cd-237a1a6f843f",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "edca6e5a1d5b23cb593464cfebb86c1e391c0d19"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-base-files",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-base-files-c146050a-959a-5836-966f-98e79d6e765f"
|
||||
}
|
||||
],
|
||||
"name": "base-files",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-base-files",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "base-files",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "b3bb39dbd3159644ac9692f78227c4b6443e86e0"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.0.14"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-base-files:SPDXRef-Recipe-base-files",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-base-files"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:06:11Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/busybox-syslog-9c50eff5-a9f9-5765-b33a-312c76b55eb2",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "91ec3759a3de2d2390a4794b7bd262e340d04909"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-busybox",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-busybox-1dd695ee-b779-5d09-9314-a0c15f2a4031"
|
||||
}
|
||||
],
|
||||
"name": "busybox-syslog",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-busybox-syslog",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only AND DocumentRef-recipe-busybox:LicenseRef-bzip2-1.0.4",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "busybox-syslog",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "9e81255daab409339d5f5a106a0e4032d61e80d9"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.36.1"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-busybox:SPDXRef-Recipe-busybox",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-busybox-syslog"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:06:11Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/busybox-udhcpc-9f92dd51-c9fd-5fc3-820f-967a10a669b3",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "91ec3759a3de2d2390a4794b7bd262e340d04909"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-busybox",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-busybox-1dd695ee-b779-5d09-9314-a0c15f2a4031"
|
||||
}
|
||||
],
|
||||
"name": "busybox-udhcpc",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-busybox-udhcpc",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only AND DocumentRef-recipe-busybox:LicenseRef-bzip2-1.0.4",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "busybox-udhcpc",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "5c3d9eed3b74e4c824f5240832cba8368b8ac205"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.36.1"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-busybox:SPDXRef-Recipe-busybox",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-busybox-udhcpc"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:06:11Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/busybox-88c2f534-0ecc-55ec-b418-e44fadbec098",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "91ec3759a3de2d2390a4794b7bd262e340d04909"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-busybox",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-busybox-1dd695ee-b779-5d09-9314-a0c15f2a4031"
|
||||
}
|
||||
],
|
||||
"name": "busybox",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-busybox",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only AND DocumentRef-recipe-busybox:LicenseRef-bzip2-1.0.4",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "busybox",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "0e6c4768e668d224ff1e5ce409ab70a079b16e9c"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.36.1"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-busybox:SPDXRef-Recipe-busybox",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-busybox"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing the source of the Yocto recipe during the build.",
|
||||
"created": "2026-10-29T07:58:08Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/core-image-minimal-qemuarm64.rootfs-20261029075646-71264365-e336-51cb-9942-5192347d5c93",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "b4d60af318fe0d42e9783c2d106c728d90688927"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-base-files",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/base-files-ee9424e3-1d7e-5739-b9cd-237a1a6f843f"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "e1b273c1808c9e78d58ef02ae62ca7ab2810f110"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-busybox",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/busybox-88c2f534-0ecc-55ec-b418-e44fadbec098"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "6f52ae9053de6ff7523d4214ddcc49eb729c070a"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-busybox-syslog",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/busybox-syslog-9c50eff5-a9f9-5765-b33a-312c76b55eb2"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "61daa9fa82460c53bd8c45c0f18d700c0cbb04d6"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-busybox-udhcpc",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/busybox-udhcpc-9f92dd51-c9fd-5fc3-820f-967a10a669b3"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "1cf263960dc530c97b5b94e1021a91a27333d146"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-libcrypto3",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/libcrypto3-c6f9821a-3ec3-5e5e-b995-f63a1bc63db4"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "6eb54bf0b4af527978aacb07c317e0af5bb6bb81"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-openssl-conf",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/openssl-conf-06cde60f-b881-5cdf-bf18-80915296bd52"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "7f01dc1c0a7a6b0f678274e642c7adee54e783c8"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-openssl-ossl-module-legacy",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/openssl-ossl-module-legacy-4a52ab8e-d398-5184-a732-a2fe507c2e0c"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "8072187d85a80da34f4fa82d2e974ebbc31a7c43"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-packagegroup-core-boot",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/packagegroup-core-boot-3461373d-eb57-5fec-b780-98ead32f9337"
|
||||
},
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "0000000000000000000000000000000000000000"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-missing-pkg",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/missing-pkg-00000000-0000-0000-0000-000000000000"
|
||||
}
|
||||
],
|
||||
"name": "core-image-minimal-qemuarm64.rootfs-20261029075646",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "NOASSERTION",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "core-image-minimal",
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.0"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-base-files:SPDXRef-Package-base-files",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-busybox:SPDXRef-Package-busybox",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-busybox-syslog:SPDXRef-Package-busybox-syslog",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-busybox-udhcpc:SPDXRef-Package-busybox-udhcpc",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-libcrypto3:SPDXRef-Package-libcrypto3",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-openssl-conf:SPDXRef-Package-openssl-conf",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-openssl-ossl-module-legacy:SPDXRef-Package-openssl-ossl-module-legacy",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-packagegroup-core-boot:SPDXRef-Package-packagegroup-core-boot",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-missing-pkg:SPDXRef-Package-missing-pkg",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-Image-core-image-minimal-qemuarm64.rootfs-20261029075646"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:03:10Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/libcrypto3-c6f9821a-3ec3-5e5e-b995-f63a1bc63db4",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "a531ba9c30d9f3fafc7b1970b2da280cea47200e"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-openssl",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-openssl-48156327-17ba-5e34-b313-de0c1f21058e"
|
||||
}
|
||||
],
|
||||
"name": "libcrypto3",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-libcrypto3",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "libcrypto3",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "1f516f081ac675ae82b5eeccb0f8e71220d34da2"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.5.9"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-openssl:SPDXRef-Recipe-openssl",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-libcrypto3"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:03:10Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/openssl-conf-06cde60f-b881-5cdf-bf18-80915296bd52",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "a531ba9c30d9f3fafc7b1970b2da280cea47200e"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-openssl",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-openssl-48156327-17ba-5e34-b313-de0c1f21058e"
|
||||
}
|
||||
],
|
||||
"name": "openssl-conf",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-openssl-conf",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "openssl-conf",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "2f6e402692175c0cb052ccc5c8d8b3dc1a9ac6d2"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.5.9"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-openssl:SPDXRef-Recipe-openssl",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-openssl-conf"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T23:03:10Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/openssl-ossl-module-legacy-4a52ab8e-d398-5184-a732-a2fe507c2e0c",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "a531ba9c30d9f3fafc7b1970b2da280cea47200e"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-openssl",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-openssl-48156327-17ba-5e34-b313-de0c1f21058e"
|
||||
}
|
||||
],
|
||||
"name": "openssl-ossl-module-legacy",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-openssl-ossl-module-legacy",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "openssl-ossl-module-legacy",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "21552bb4d5827e5558d13e367d674608181900f5"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.5.9"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-openssl:SPDXRef-Recipe-openssl",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-openssl-ossl-module-legacy"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing packages created during the build.",
|
||||
"created": "2026-10-28T22:48:47Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/packagegroup-core-boot-3461373d-eb57-5fec-b780-98ead32f9337",
|
||||
"externalDocumentRefs": [
|
||||
{
|
||||
"checksum": {
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "a357a34614698e373698c9d1e378c11026311560"
|
||||
},
|
||||
"externalDocumentId": "DocumentRef-recipe-packagegroup-core-boot",
|
||||
"spdxDocument": "http://spdx.org/spdxdocs/recipe-packagegroup-core-boot-14d22e2f-db47-5b86-a08e-b921c83de151"
|
||||
}
|
||||
],
|
||||
"name": "packagegroup-core-boot",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Package-packagegroup-core-boot",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "MIT",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "packagegroup-core-boot",
|
||||
"packageVerificationCode": {
|
||||
"packageVerificationCodeValue": "da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
},
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.0"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "DocumentRef-recipe-packagegroup-core-boot:SPDXRef-Recipe-packagegroup-core-boot",
|
||||
"relationshipType": "GENERATED_FROM",
|
||||
"spdxElementId": "SPDXRef-Package-packagegroup-core-boot"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing recipe files during the build.",
|
||||
"created": "2026-10-28T22:48:52Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/recipe-base-files-c146050a-959a-5836-966f-98e79d6e765f",
|
||||
"name": "recipe-base-files",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Recipe-base-files",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceLocator": "cpe:2.3:*:*:base-files:3.0.14:*:*:*:*:*:*:*",
|
||||
"referenceType": "http://spdx.org/rdf/references/cpe23Type"
|
||||
}
|
||||
],
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "base-files",
|
||||
"summary": "Miscellaneous files for the base system",
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.0.14"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Recipe-base-files",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing recipe files during the build.",
|
||||
"created": "2026-10-28T23:06:11Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/recipe-busybox-1dd695ee-b779-5d09-9314-a0c15f2a4031",
|
||||
"name": "recipe-busybox",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Recipe-busybox",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceLocator": "cpe:2.3:*:*:busybox:1.36.1:*:*:*:*:*:*:*",
|
||||
"referenceType": "http://spdx.org/rdf/references/cpe23Type"
|
||||
}
|
||||
],
|
||||
"homepage": "https://www.busybox.net",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "GPL-2.0-only AND LicenseRef-bzip2-1.0.4",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "busybox",
|
||||
"sourceInfo": "CVEs fixed: CVE-2023-42363 CVE-2023-39810 CVE-2025-60876 CVE-2024-58251 CVE-2021-42380 CVE-2022-48174 CVE-2026-26157 CVE-2023-42364 CVE-2023-42365 CVE-2026-38754 CVE-2026-29004 CVE-2025-46394 CVE-2023-42366 CVE-2026-26158 CVE-2022-28391",
|
||||
"summary": "Tiny versions of many common UNIX utilities in a single small executable",
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.36.1"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Recipe-busybox",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Download-busybox-1",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing recipe files during the build.",
|
||||
"created": "2026-10-28T23:03:10Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/recipe-openssl-48156327-17ba-5e34-b313-de0c1f21058e",
|
||||
"name": "recipe-openssl",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Recipe-openssl",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceLocator": "cpe:2.3:*:openssl:openssl:3.5.9:*:*:*:*:*:*:*",
|
||||
"referenceType": "http://spdx.org/rdf/references/cpe23Type"
|
||||
}
|
||||
],
|
||||
"homepage": "http://www.openssl.org/",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "openssl",
|
||||
"summary": "Secure Socket Layer",
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "3.5.9"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Recipe-openssl",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Download-openssl-1",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"creationInfo": {
|
||||
"comment": "This document was created by analyzing recipe files during the build.",
|
||||
"created": "2026-10-28T22:48:47Z",
|
||||
"creators": [
|
||||
"Tool: OpenEmbedded Core create-spdx.bbclass",
|
||||
"Organization: OpenEmbedded ()",
|
||||
"Person: N/A ()"
|
||||
],
|
||||
"licenseListVersion": "3.14"
|
||||
},
|
||||
"dataLicense": "CC0-1.0",
|
||||
"documentNamespace": "http://spdx.org/spdxdocs/recipe-packagegroup-core-boot-14d22e2f-db47-5b86-a08e-b921c83de151",
|
||||
"name": "recipe-packagegroup-core-boot",
|
||||
"packages": [
|
||||
{
|
||||
"SPDXID": "SPDXRef-Recipe-packagegroup-core-boot",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "MIT",
|
||||
"licenseInfoFromFiles": [
|
||||
"NOASSERTION"
|
||||
],
|
||||
"name": "packagegroup-core-boot",
|
||||
"summary": "Minimal boot requirements",
|
||||
"supplier": "Organization: OpenEmbedded ()",
|
||||
"versionInfo": "1.0"
|
||||
}
|
||||
],
|
||||
"relationships": [
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-Recipe-packagegroup-core-boot",
|
||||
"relationshipType": "DESCRIBES",
|
||||
"spdxElementId": "SPDXRef-DOCUMENT"
|
||||
}
|
||||
],
|
||||
"spdxVersion": "SPDX-2.2"
|
||||
}
|
||||
Reference in new issue
Block a user