v0.25.9: built-in AACS keys + plugin slot + MKB record-type fix

Two changes that make AACS 1.0 / DVD self-sufficient:

1. MKB record-type identification bug fix. `mkb_find_mk_dv` was
   searching for type 0x10 (which is Type-and-Version, 12 bytes)
   when the Verify Media Key Record is actually type 0x81 for
   AACS 1.0 or type 0x86 for AACS 2.0/2.1. `mkb_version` had the
   inverse bug. PK and DK derivation paths therefore silently
   failed on every disc, masking how often the fallback paths
   could have worked. Fix searches the correct types; tests added
   covering both the 0x81 and 0x86 verify-record forms and the
   0x10 version record at offset 8 of the body.

2. Built-in AACS keys + operator plugin slot. Four device keys
   (covering MKB v01-v82+) and three processing keys (covering
   v63-v68) compiled directly into the library. Combined with the
   31 CSS player keys already in css/auth.rs, DVDs and Blu-rays
   (AACS 1.0) now decrypt with zero external files. New plugin
   path at ~/.config/freemkv/local_keys.cfg (same syntax as
   keydb.cfg) layered additively on top of built-ins and main
   keydb. `Disc::scan` no longer errors when keydb.cfg is absent;
   AACS 2.0 / UHD still surfaces a specific error when the disc
   needs keys none of the layers provide.

Public docstrings in CLAUDE.md + README updated to describe the
three additive layers (built-ins → keydb.cfg → local_keys.cfg).
This commit is contained in:
2026-05-20 09:00:32 -07:00
parent e8c4df347f
commit 1b9db6e9a4
11 changed files with 588 additions and 73 deletions
+18
View File
@@ -26,6 +26,24 @@ The library contains ZERO user-facing English text. All errors use numeric codes
- `--raw` only skips decryption. Init/probe/speed still run.
- Each function does one thing. One runner orchestrates the sequence.
## AACS key sources
Three additive layers, loaded in this order:
1. **Built-in keys** (compiled in). Cover DVDs (CSS) and Blu-rays (AACS 1.0)
across the public MKB range. No external file required for those discs.
2. **Main `keydb.cfg`** at `~/.config/freemkv/keydb.cfg` (or via
`ScanOptions::keydb_path`). Required for UHD (AACS 2.0 / 2.1) — supplies
per-disc VUKs / media keys. Optional for DVD/BD.
3. **Operator plugin** at `~/.config/freemkv/local_keys.cfg`. Same syntax as
`keydb.cfg`; merged additively on top of the built-ins and the main keydb.
For operators who derive their own device keys, processing keys, or VUKs.
The library MUST NOT treat a missing `keydb.cfg` as fatal — only as
"no UHD-specific keys available." DVD and BD decryption proceeds from
built-ins. Error `E7000` fires only when a disc actually needs keys
the library does not have.
## macOS IOKit transport
The macOS SCSI transport uses exclusive IOKit access, not hybrid MMC+pread.