mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2024-12-28 12:07:39 +06: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
@ -989,7 +989,13 @@ class DrmIonVoucher(object):
|
|||||||
try:
|
try:
|
||||||
b = aes.decrypt(self.ciphertext)
|
b = aes.decrypt(self.ciphertext)
|
||||||
b = pkcs7unpad(b, 16)
|
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
|
decrypted=True
|
||||||
|
|
||||||
print("Decryption succeeded")
|
print("Decryption succeeded")
|
||||||
break
|
break
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
@ -997,14 +1003,6 @@ class DrmIonVoucher(object):
|
|||||||
if not decrypted:
|
if not decrypted:
|
||||||
raise ex
|
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()
|
self.drmkey.stepin()
|
||||||
while self.drmkey.hasnext():
|
while self.drmkey.hasnext():
|
||||||
self.drmkey.next()
|
self.drmkey.next()
|
||||||
|
Loading…
Reference in New Issue
Block a user