Skip to main content

Module verify_asset

Module verify_asset 

Source
Expand description

The single asset-acknowledgement chokepoint (SSoT: Keys — Write Authorization).

verify_asset is the only path by which a client accepts an asset into its trusted set. It returns one of three outcomes — never a silent drop, never a silent accept:

  • VerifyOutcome::Accept — both signatures valid, epoch within the MLS-attested ceiling, chain head matches, AMK locally held.
  • VerifyOutcome::TerminalReject — reader-signed / removed-writer / wrong-epoch / forged-chain / replayed / suite-downgrade / bad device sig … → quarantine.
  • VerifyOutcome::Pending — epoch is within the attested range but its AMK content key has not arrived yet → hold and retry, never quarantine.

Authorization authority is the album’s admin-signed MLS commit chain (the AlbumAuthority), never the server. It ships with an exhaustive negative-case test surface, since every negative is a real damage scenario.

Enums§

BindingReject
Why a metadata blob fails to bind to its manifest and the locally-signed sidecar.
MetadataBinding
The outcome of the metadata↔manifest round-trip binding check (client-side; SSoT: Metadata — Local and Server Metadata Equivalence).
PendingReason
Why a manifest is pending rather than accepted.
RejectReason
Why a manifest was terminally rejected. Each maps to a damage scenario.
VerifyOutcome
The outcome of verify_asset.

Functions§

diagnose_misattributed_signer
Diagnose a RejectReason::BadDeviceSig as the legacy inherited-device defect (issue #475) rather than a forgery, returning the directory device that actually signed the record.
verify_asset
Verify a manifest against the device directory, the album’s MLS-attested authority, and the local provenance chain head. The one path by which an asset is acknowledged.
verify_asset_hashed
verify_asset over the ciphertext’s SHA-256 rather than its bytes, for a caller that streams a ciphertext too large to hold. Step 5 compares ciphertext_hash with the manifest’s content address, so it vouches for the bytes only as far as the caller’s digest does: a caller that has not hashed them yet must hash what it then reads and refuse it unless the result equals this argument. Every other step is verify_asset’s, unchanged.
verify_device_signature
Steps 6–8 of verify_asset: the manifest’s signer is a device of directory, added no later than the manifest’s timestamp, and its signing key produced device_sig.
verify_metadata_binding
Run the metadata↔manifest round-trip equivalence check for a metadata-bearing manifest (SSoT: Metadata — Local and Server Metadata Equivalence, Encryption — Local–server equivalence). Two facts must hold, both funnelling a failure into a quarantine: