From 1e60220ff6f8fd36f19a5df066ce1d6156484acb Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:45:40 -0700 Subject: [PATCH] AACS: KeySource::needs_samples() gates the content-sample read A source that validates server-side against ciphertext (an online key service) needs encrypted content samples; one that keys on disc identity (keydb, mapfile) does not. needs_samples() lets the caller skip the extra disc read unless a configured source actually needs it. Defaults false. --- src/keysource.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/keysource.rs b/src/keysource.rs index 0b20c2e..fa4b325 100644 --- a/src/keysource.rs +++ b/src/keysource.rs @@ -58,4 +58,12 @@ pub trait KeySource { /// Candidate keys for this disc, most-specific first. Empty = this source /// has nothing; `Err(_)` = the source itself failed (I/O, network, parse). fn resolve(&self, inputs: &DiscInputs) -> Result>; + + /// Whether this source needs [`DiscInputs::samples`] populated (encrypted + /// content samples) — true for a source that validates against ciphertext + /// server-side, false for one that keys purely on disc identity. The caller + /// reads samples (an extra disc read) only when some source needs them. + fn needs_samples(&self) -> bool { + false + } }