From ca42e028a7f3693dc2a1005b33e05d4eaa07d1db Mon Sep 17 00:00:00 2001 From: apprenticeharper Date: Thu, 14 Jan 2016 17:15:43 +0000 Subject: Regression bug fixes --- DeDRM_calibre_plugin/DeDRM_plugin.zip | Bin 344915 -> 344949 bytes DeDRM_calibre_plugin/DeDRM_plugin/__init__.py | 3 ++- DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py | 13 ++++--------- DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py | 10 +++------- DeDRM_calibre_plugin/DeDRM_plugin/wineutils.py | 8 ++++---- 5 files changed, 13 insertions(+), 21 deletions(-) (limited to 'DeDRM_calibre_plugin') diff --git a/DeDRM_calibre_plugin/DeDRM_plugin.zip b/DeDRM_calibre_plugin/DeDRM_plugin.zip index 05cfb8f..8c0dcea 100644 Binary files a/DeDRM_calibre_plugin/DeDRM_plugin.zip and b/DeDRM_calibre_plugin/DeDRM_plugin.zip differ diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py index 3254222..ceef266 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py @@ -47,6 +47,7 @@ __docformat__ = 'restructuredtext en' # 6.3.3 - Bug fix for Kindle for PC support # 6.3.4 - Fixes for Kindle for Android, Linux, and Kobo 3.17 # 6.3.5 - Fixes for Linux, and Kobo 3.19 and more logging +# 6.3.6 - Fixes for ADE ePub and PDF introduced in 6.3.5 """ @@ -54,7 +55,7 @@ Decrypt DRMed ebooks. """ PLUGIN_NAME = u"DeDRM" -PLUGIN_VERSION_TUPLE = (6, 3, 5) +PLUGIN_VERSION_TUPLE = (6, 3, 6) PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE]) # Include an html helpfile in the plugin's zipfile with the following name. RESOURCE_NAME = PLUGIN_NAME + '_Help.htm' diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py b/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py index 5987b8c..5c135ad 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py @@ -3,7 +3,7 @@ from __future__ import with_statement -# ineptepub.pyw, version 6.3 +# ineptepub.pyw, version 6.4 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 @@ -40,13 +40,14 @@ from __future__ import with_statement # 6.1 - Work if TkInter is missing # 6.2 - Handle UTF-8 file names inside an ePub, fix by Jose Luis # 6.3 - Add additional check on DER file sanity +# 6.4 - Remove erroneous check on DER file sanity """ Decrypt Adobe Digital Editions encrypted ePub books. """ __license__ = 'GPL v3' -__version__ = "6.3" +__version__ = "6.4" import sys import os @@ -171,14 +172,9 @@ def _load_crypto_libcrypto(): def __init__(self, der): buf = create_string_buffer(der) pp = c_char_pp(cast(buf, c_char_p)) - rsa = self._rsa = d2i_RSAPrivateKey(None, pp, len(der)) + rsa = self._rsa = d2i_RSAPrivateKey(None, pp, len(der)) if rsa is None: raise ADEPTError('Error parsing ADEPT user key DER') - # check if pointer is not NULL - try: - c = self._rsa.contents - except ValueError: - raise ADEPTError('Error parsing ADEPT user key DER') def decrypt(self, from_): rsa = self._rsa @@ -326,7 +322,6 @@ def _load_crypto_pycrypto(): except ValueError: raise ADEPTError('Error parsing ADEPT user key DER') - def bytesToNumber(self, bytes): total = 0L for byte in bytes: diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py b/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py index 3967647..839297f 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py @@ -3,7 +3,7 @@ from __future__ import with_statement -# ineptpdf.pyw, version 8.0.2 +# ineptpdf.pyw, version 8.0.3 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 @@ -55,6 +55,7 @@ from __future__ import with_statement # 8.0 - Work if TkInter is missing # 8.0.1 - Broken Metadata fix. # 8.0.2 - Add additional check on DER file sanity +# 8.0.3 - Remove erroneous check on DER file sanity """ @@ -62,7 +63,7 @@ Decrypts Adobe ADEPT-encrypted PDF files. """ __license__ = 'GPL v3' -__version__ = "8.0.2" +__version__ = "8.0.3" import sys import os @@ -201,11 +202,6 @@ def _load_crypto_libcrypto(): rsa = self._rsa = d2i_RSAPrivateKey(None, pp, len(der)) if rsa is None: raise ADEPTError('Error parsing ADEPT user key DER') - # check if pointer is not NULL - try: - c = self._rsa.contents - except ValueError: - raise ADEPTError('Error parsing ADEPT user key DER') def decrypt(self, from_): rsa = self._rsa diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/wineutils.py b/DeDRM_calibre_plugin/DeDRM_plugin/wineutils.py index f2f8edc..fff8016 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/wineutils.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/wineutils.py @@ -41,15 +41,15 @@ def WineGetKeys(scriptpath, extension, wineprefix=""): print u"{0} v{1}: Wine subprocess call error: {2}".format(PLUGIN_NAME, PLUGIN_VERSION, e.args[0]) if wineprefix != "" and os.path.exists(wineprefix): cmdline = u"WINEPREFIX=\"{2}\" wine C:\\Python27\\python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix) - else: + else: cmdline = u"wine C:\\Python27\\python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath) - print u"{0} v{1}: Command line: “{2}”".format(PLUGIN_NAME, PLUGIN_VERSION, cmdline) + print u"{0} v{1}: Command line: “{2}”".format(PLUGIN_NAME, PLUGIN_VERSION, cmdline) - try: + try: cmdline = cmdline.encode(sys.getfilesystemencoding()) p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=sys.stdout, stderr=STDOUT, close_fds=False) result = p2.wait("wait") - except Exception, e: + except Exception, e: print u"{0} v{1}: Wine subprocess call error: {2}".format(PLUGIN_NAME, PLUGIN_VERSION, e.args[0]) # try finding winekeys anyway, even if above code errored -- cgit v1.2.3