mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2025-10-23 23:07:47 -04:00
Fix issue with remaining data in encryption.xml
This commit is contained in:
parent
3151dbbd98
commit
3c12806f38
1 changed files with 2 additions and 2 deletions
|
|
@ -89,7 +89,7 @@ class Decryptor(object):
|
||||||
def __init__(self, bookkey, encryption):
|
def __init__(self, bookkey, encryption):
|
||||||
enc = lambda tag: '{%s}%s' % (NSMAP['enc'], tag)
|
enc = lambda tag: '{%s}%s' % (NSMAP['enc'], tag)
|
||||||
self._aes = AES.new(bookkey, AES.MODE_CBC, b'\x00'*16)
|
self._aes = AES.new(bookkey, AES.MODE_CBC, b'\x00'*16)
|
||||||
encryption = etree.fromstring(encryption)
|
self._encryption = etree.fromstring(encryption)
|
||||||
self._encrypted = encrypted = set()
|
self._encrypted = encrypted = set()
|
||||||
self._otherData = otherData = set()
|
self._otherData = otherData = set()
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ class Decryptor(object):
|
||||||
self._has_remaining_xml = False
|
self._has_remaining_xml = False
|
||||||
expr = './%s/%s/%s' % (enc('EncryptedData'), enc('CipherData'),
|
expr = './%s/%s/%s' % (enc('EncryptedData'), enc('CipherData'),
|
||||||
enc('CipherReference'))
|
enc('CipherReference'))
|
||||||
for elem in encryption.findall(expr):
|
for elem in self._encryption.findall(expr):
|
||||||
path = elem.get('URI', None)
|
path = elem.get('URI', None)
|
||||||
encryption_type_url = (elem.getparent().getparent().find("./%s" % (enc('EncryptionMethod'))).get('Algorithm', None))
|
encryption_type_url = (elem.getparent().getparent().find("./%s" % (enc('EncryptionMethod'))).get('Algorithm', None))
|
||||||
if path is not None:
|
if path is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue