pub struct ContentDigest(/* private fields */);Expand description
Cryptographic digest of an image attachment’s bytes at grant time.
Stored on ContentPart::Image so the provider adapter can detect
same-path replacement attacks: when the adapter re-reads the file
at request time, it recomputes the digest and compares. A mismatch
means the file was replaced between grant and read, and the part
MUST be omitted (Owner P1-B security rework, 2026-07-21).
Backed by SHA-256 ([u8; 32]). The hash itself is computed in
talos_cli::image_validation; talos-core only carries the typed
digest so it has no sha2 dependency. Serde uses a lowercase hex
string so TLOG dumps remain human-readable.
The default is the all-zero “unverified” sentinel: a freshly
constructed ContentPart that has not yet been through
validate_image_path carries this. Provider adapters treat the
default as “verification intentionally skipped” — only test
fixtures and unverified in-memory parts use this path.
Implementations§
Source§impl ContentDigest
impl ContentDigest
Trait Implementations§
Source§impl Clone for ContentDigest
impl Clone for ContentDigest
Source§fn clone(&self) -> ContentDigest
fn clone(&self) -> ContentDigest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more