fix(vaults): verify vault content keys per KID from the fragment map

Map each KID to its fragments from the ciphertext moov/moof (tenc, seig, ISM duration clock) and decode up to three windows per KID that never cross into another KID, so a clear lead cannot hide a wrong key and only the failing KID is flagged. Decode every frame (wrong-key HEVC keyframes decode clean), re-judge mid-GOP starts on keyframes, time out every FFmpeg run, and refuse to store a flagged pair again in SQLite.
This commit is contained in:
imSp4rky
2026-09-18 01:10:14 -06:00
parent cf2906f120
commit b30e6d7cbe
10 changed files with 921 additions and 41 deletions
+4 -1
View File
@@ -28,6 +28,7 @@ class Vaults:
self.sources: dict[Union[UUID, str], tuple[str, Vault]] = {}
self.flagged: set[tuple[Union[UUID, str], str]] = set()
self.candidates: dict[Union[UUID, str], list[tuple[str, Vault]]] = {}
self.warned: set[tuple[str, Union[UUID, str], str]] = set()
def __iter__(self) -> Iterator[Vault]:
return iter(self.vaults)
@@ -134,8 +135,10 @@ class Vaults:
return None
found = bool(key and key.count("0") != len(key))
if found and key and self.is_flagged(kid, key):
log.warning(f"{key} from {vault.name} is flagged bad, skipping")
found = False
if (vault.name, kid, key) not in self.warned:
self.warned.add((vault.name, kid, key))
log.warning(f"{key} from {vault.name} is flagged bad, skipping")
if dl:
dl.log_vault_query(
vault.name,