mirror of
https://github.com/noDRM/DeDRM_tools
synced 2024-11-16 19:48:10 +01:00
Added fix for padding being correct on accident
Co-authored-by: Satsuoni <satsuoni@hotmail.com>
This commit is contained in:
parent
f86cff285b
commit
133e67fa03
1 changed files with 6 additions and 8 deletions
|
@ -989,7 +989,13 @@ class DrmIonVoucher(object):
|
|||
try:
|
||||
b = aes.decrypt(self.ciphertext)
|
||||
b = pkcs7unpad(b, 16)
|
||||
self.drmkey = BinaryIonParser(BytesIO(b))
|
||||
addprottable(self.drmkey)
|
||||
|
||||
_assert(self.drmkey.hasnext() and self.drmkey.next() == TID_LIST and self.drmkey.gettypename() == "com.amazon.drm.KeySet@1.0",
|
||||
"Expected KeySet, got %s" % self.drmkey.gettypename())
|
||||
decrypted=True
|
||||
|
||||
print("Decryption succeeded")
|
||||
break
|
||||
except Exception as ex:
|
||||
|
@ -997,14 +1003,6 @@ class DrmIonVoucher(object):
|
|||
if not decrypted:
|
||||
raise ex
|
||||
|
||||
sharedsecret = obfuscate(shared, self.version)
|
||||
|
||||
self.drmkey = BinaryIonParser(BytesIO(b))
|
||||
addprottable(self.drmkey)
|
||||
|
||||
_assert(self.drmkey.hasnext() and self.drmkey.next() == TID_LIST and self.drmkey.gettypename() == "com.amazon.drm.KeySet@1.0",
|
||||
"Expected KeySet, got %s" % self.drmkey.gettypename())
|
||||
|
||||
self.drmkey.stepin()
|
||||
while self.drmkey.hasnext():
|
||||
self.drmkey.next()
|
||||
|
|
Loading…
Reference in a new issue