summaryrefslogtreecommitdiffstats
path: root/DeDRM_plugin
diff options
context:
space:
mode:
authorNoDRM <[email protected]>2023-06-25 16:27:31 +0200
committerNoDRM <[email protected]>2023-06-25 16:27:31 +0200
commit133e67fa0314a484e188367410b41975054180d7 (patch)
treee83e94cd8625e808c86e0c1b84b1e5893d997e65 /DeDRM_plugin
parentf86cff285be1ed43c296e4adc2c3899ca14fd64b (diff)
Added fix for padding being correct on accident
Co-authored-by: Satsuoni <[email protected]>
Diffstat (limited to 'DeDRM_plugin')
-rw-r--r--DeDRM_plugin/ion.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/DeDRM_plugin/ion.py b/DeDRM_plugin/ion.py
index 7e3c9de..a268c63 100644
--- a/DeDRM_plugin/ion.py
+++ b/DeDRM_plugin/ion.py
@@ -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() == "[email protected]",
+ "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() == "[email protected]",
- "Expected KeySet, got %s" % self.drmkey.gettypename())
-
self.drmkey.stepin()
while self.drmkey.hasnext():
self.drmkey.next()