keys: trust the declared CPS units instead of probing every stream file

1.8.0 read up to 32 units from every stream file before asking any key
source: 1,472 random reads (~95 s over USB) on a 46-file UHD that declares
one CPS unit, answered by one keyserver request.

One declared unit: the main title's samples ask once and the key that
opens them keys every file. Several: one encrypted unit per file, then
each unopened unit asks with 8 of its own units; one answer may open many
files. A source answering no key is not asked again, and a disc no key
opens is refused at once (blanked in a whole-disc copy) rather than
probed. Discs with an FMTS layout in scope keep the probed path.

Key acquisition also logs its phase timings.
This commit is contained in:
Matthew Jackson
2026-10-07 03:31:29 -07:00
parent 6acc55b246
commit af62d6d5d8
6 changed files with 484 additions and 134 deletions
@@ -10,18 +10,11 @@ copy-raw image = 8466432 bytes sha256:f0856c74bf5c9f7b6822186cafcaf1d6
extract-raw result = good=73728 unreadable=0 complete=true halted=false files=[("BDMV/STREAM/00001.m2ts", 36864, 0, true), ("BDMV/STREAM/00002.m2ts", 36864, 0, true)]
extract-raw out BDMV/STREAM/00001.m2ts = 36864 bytes sha256:375559f987f4f85e585d39abe6eb12fa
extract-raw out BDMV/STREAM/00002.m2ts = 36864 bytes sha256:2d895155c02331f792c4fca0bfb881ea
resolve-title status = KeySetStatus { proven: 1, declared: Some(2), keyed: 1, clear: 0, lazy: 1, forensic: None, origin: Some("keydb"), best_effort: false, requests: 1 }
title-read = 36864 bytes sha256:368a55d7eca3e25f6af377a6f1aec041
title-read blanked = 0
title-read failed = E7022
resolve-title = refused E7022
iso-mkv refused = E7022
iso-mkv out o.mkv = 21863 bytes sha256:47337f351b04ebb679c0da200a04e94a
iso-m2ts refused = E7022
iso-m2ts out o.m2ts = 31488 bytes sha256:3a40b2a87a7e62135df01ead62597601
iso-null refused = E7022
iso-mkv-raw refused = E6008
iso-mkv-selection refused = E7022
iso-mkv-selection out o.mkv = 15124 bytes sha256:120947d4cc4150b1531e918c11865049
live-mkv refused = E7022
live-mkv out o.mkv = 21863 bytes sha256:47337f351b04ebb679c0da200a04e94a
live-mkv-raw refused = E6008