Commit Graph
5 Commits
Author SHA1 Message Date
MattJackson 309621ac45 KeydbSource::host_certs() — the keydb's second data type, for DriveCredentials 2026-06-04 16:04:06 -07:00
MattJackson c6f1ec1fcc OnlineSource: minimal client; POST to the configured URL verbatim
Drop unused tracing dep. The endpoint URL is taken from config as-is, so a
change on the service side is a config change, not a code change.
2026-06-04 15:33:34 -07:00
MattJackson 0e65237ce7 OnlineSource::needs_samples() = true (validates against ciphertext) 2026-06-04 14:45:49 -07:00
MattJackson 681e7a0295 Add OnlineSource and MapfileSource
OnlineSource: the remote key-service client (moved out of autorip), posting the
disc's Unit_Key_RO.inf + MKB + Volume ID + encrypted content samples to the
service and returning the resolved unit key as a terminal Key::Unit candidate.
Kept out of libfreemkv so the library stays network-free. Source-internal
failures (unreachable / status / parse) are logged and surface as "no
candidate" so the next source is tried.

MapfileSource: reads a rip mapfile's persisted unit keys (the resume / deferred-
mux fast path) and offers them as a Key::Unit candidate. Keyed by mapfile path.

DiscInputs gained an app-populated `samples` field for sources that validate
against ciphertext server-side (OnlineSource); local sources ignore it.
2026-06-04 14:42:02 -07:00
MattJackson d2e0ecc2d4 freemkv-keysources: new crate — KeydbSource + ordered-resolve helper
The published key-source layer for libfreemkv. libfreemkv does no lookup; it
is handed a Key and derives down. This crate provides the KeySource impls that
do the lookup and hand a Key in. Applications choose and order the sources.

This first cut ships:
- KeydbSource: parses a local keydb.cfg and enumerates its material as ordered
  candidate keys (per-disc VUK/unit/media first, then the universal device-key,
  processing-key, and media-key pools). It does no derivation — the library
  walks the MKB and verifies media keys. Candidate ordering lets the library
  try each path a keydb can satisfy.
- resolve_first: tries each source's candidates in order and returns the first
  the caller's validator accepts (validate-before-return), so a stale entry
  falls through to the next source.

OnlineSource (remote key service) and MapfileSource (cached unit key) land with
the application wiring, where the sample-read and mapfile paths already live.
2026-06-04 14:35:54 -07:00