Copyright © 2013-2020 Apprentice Harper et al.
"""
+from __future__ import annotations
import collections
import hashlib
process_V4648(shared), process_V5683(shared)]
decrypted=False
- ex=None
+ lastexception: Exception | None = None
for sharedsecret in sharedsecrets:
key = hmac.new(sharedsecret, b"PIDv3", digestmod=hashlib.sha256).digest()
aes = AES.new(key[:32], AES.MODE_CBC, self.cipheriv[:16])
print("Decryption succeeded")
break
except Exception as ex:
+ lastexception = ex
print("Decryption failed, trying next fallback ")
if not decrypted:
- raise ex
+ raise lastexception
self.drmkey.stepin()
while self.drmkey.hasnext():