]> xmof Git - DeDRM.git/commitdiff
Fix for decryption check
authorAldo Bleeker <mail@ableeker.demon.nl>
Mon, 28 Jun 2021 14:59:15 +0000 (16:59 +0200)
committerNoDRM <no_drm123@protonmail.com>
Mon, 15 Nov 2021 13:44:20 +0000 (14:44 +0100)
Obok_plugin/action.py

index 1a4515b419490de7e491210deec8b92cdd44441d..fb8f26efd3127a24c7dcd67b40640ea972229f4e 100644 (file)
@@ -375,7 +375,6 @@ class InterfacePluginAction(InterfaceAction):
         #print ('Kobo library filename: {0}'.format(book.filename))
         for userkey in self.userkeys:
             print (_('Trying key: '), codecs.encode(userkey, 'hex'))
-            check = True
             try:
                 fileout = PersistentTemporaryFile('.epub', dir=self.tdir)
                 #print ('Temp file: {0}'.format(fileout.name))
@@ -396,8 +395,7 @@ class InterfacePluginAction(InterfaceAction):
                         file = book.encryptedfiles[filename]
                         contents = file.decrypt(userkey, contents)
                         # Parse failures mean the key is probably wrong.
-                        if check:
-                            check = not file.check(contents)
+                        file.check(contents)
                     zout.writestr(filename, contents)
                 zout.close()
                 zin.close()