Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFError when trying the wrong key first #42

Closed
clayote opened this issue Oct 10, 2015 · 12 comments
Closed

EOFError when trying the wrong key first #42

clayote opened this issue Oct 10, 2015 · 12 comments

Comments

@clayote
Copy link

clayote commented Oct 10, 2015

I'm on Kubuntu Vivid 64-bit and have reproduced this bug with Calibre versions 2.20 and 2.28, DeDRM tools v6.3.4a.

I have imported two .der files into the plugin. When I try to add a book freshly downloaded by the Digital Editions app, I get an ERROR: Cannot add books with details:

Worker process crashed while executing job
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/utils/ipc/pool.py", line 103, in recv
    result = cPickle.loads(eintr_retry_call(self.conn.recv_bytes))
  File "/usr/lib/calibre/calibre/utils/ipc/__init__.py", line 19, in eintr_retry_call
    return func(*args, **kwargs)
EOFError

The output in the terminal makes it appear that DeDRM tried decrypting with the wrong key first and then just...gave up?

DeDRM v6.3.4: Trying to decrypt The_Annihilation_Score.epub                         
DeDRM v6.3.4: Verifying zip archive integrity                                       
DeDRM v6.3.4: The_Annihilation_Score.epub is a secure Adobe Adept ePub              
DeDRM v6.3.4: Trying Encryption key calibre-adeptkey                                
No node found for item that was just removed:  QUrl( "file:///home/sanotehu/Documents/My Digital Editions/manifest.xml" )

I can de-DRM the book by removing all but the key it really needs, but I think I should be able to have more than one key.

@apprenticeharper
Copy link
Owner

I don't recognize those errors at all. I'll try to reproduce, but I'd be surprised if it was a plugin error.

@apprenticeharper
Copy link
Owner

I don't have a valid, incorrect .der file to test with. Could you email me one of yours? apprenticeharper@gmail.com Thanks.

@apprenticeharper
Copy link
Owner

I can't reproduce on Windows with calibre 2.2.2 and 6.,3.3. Just trying with 2.4.0 and 6.3.4

Microsoft Windows Version 6.3.9600 2013 Microsoft Corporation. All rights reserved.

C:\Users\Harper>calibre-debug -g
calibre 2.22 [64bit] isfrozen: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Successfully initialized third party plugins: DeDRM && Obok DeDRM
Starting up...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 using xml.etree for xml parsing
DEBUG: 0.1 obok::action_err.py - loading translations
Started up in 2.97 seconds with 8 books
DeDRM v6.3.3: Trying to decrypt Floating Gold A Natural (and Unnatural) History
of Ambergris.epub
DeDRM v6.3.3: Verifying zip archive integrity
DeDRM v6.3.3: Floating Gold A Natural (and Unnatural) History of Ambergris.epub
is a secure Adobe Adept ePub
DeDRM v6.3.3: Trying Encryption key other_key
DeDRM v6.3.3: Exception when decrypting after 0.2 seconds
Traceback (most recent call last):
File "calibre_plugins.dedrm.init", line 292, in ePubDecrypt
File "calibre_plugins.dedrm.ineptepub", line 398, in decryptBook
File "calibre_plugins.dedrm.ineptepub", line 313, in init
File "calibre_plugins.dedrm.ineptepub", line 290, in getChild
File "calibre_plugins.dedrm.ineptepub", line 227, in get
ASN1Error: Error decoding ASN.1
DeDRM v6.3.3: Failed to decrypt with key other_key after 0.2 seconds
DeDRM v6.3.3: Trying Encryption key real_key
DeDRM v6.3.3: Finished after 1.3 seconds
Added Floating Gold: A Natural (and Unnatural) History of Ambergris to db in: 0.
4
Added 1 books in 4.0 seconds

@apprenticeharper
Copy link
Owner

Can't reproduce with 6.3.4 and 2.2.2, although there's something nasty going on at the end.

Microsoft Windows Version 6.3.9600 2013 Microsoft Corporation. All rights reserved.

C:\Users\Harper>calibre-debug -g
calibre 2.22 [64bit] isfrozen: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Successfully initialized third party plugins: DeDRM && Obok DeDRM
Starting up...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.0 using xml.etree for xml parsing
DEBUG: 0.1 obok::action_err.py - loading translations
Started up in 2.62 seconds with 7 books
DeDRM v6.3.4: Trying to decrypt Floating Gold A Natural (and Unnatural) History
of Ambergris.epub
DeDRM v6.3.4: Verifying zip archive integrity
DeDRM v6.3.4: Floating Gold A Natural (and Unnatural) History of Ambergris.epub
is a secure Adobe Adept ePub
DeDRM v6.3.4: Trying Encryption key real_key
DeDRM v6.3.4: Finished after 1.4 seconds
Added Floating Gold: A Natural (and Unnatural) History of Ambergris to db in: 1.
4
Added 1 books in 5.3 seconds
DeDRM v6.3.4: Trying to decrypt Floating Gold A Natural (and Unnatural) History
of Ambergris.epub
DeDRM v6.3.4: Verifying zip archive integrity
DeDRM v6.3.4: Floating Gold A Natural (and Unnatural) History of Ambergris.epub
is a secure Adobe Adept ePub
DeDRM v6.3.4: Trying Encryption key other_key
DeDRM v6.3.4: Exception when decrypting after 0.2 seconds
Traceback (most recent call last):
File "calibre_plugins.dedrm.init", line 293, in ePubDecrypt
File "calibre_plugins.dedrm.ineptepub", line 398, in decryptBook
File "calibre_plugins.dedrm.ineptepub", line 313, in init
File "calibre_plugins.dedrm.ineptepub", line 290, in getChild
File "calibre_plugins.dedrm.ineptepub", line 227, in get
ASN1Error: Error decoding ASN.1
DeDRM v6.3.4: Failed to decrypt with key other_key after 0.2 seconds
DeDRM v6.3.4: Looking for new default Adobe Digital Editions Keys after 0.2 seco
nds
Found 1 keys
DeDRM v6.3.4: Trying a new default key
DeDRM v6.3.4: Saving a new default key
DeDRM v6.3.4: Saved a new default key after 1.4 seconds
DeDRM v6.3.4: Finished after 1.4 seconds
Added Floating Gold: A Natural (and Unnatural) History of Ambergris to db in: 0.
4
Added 1 books in 4.3 seconds
Exception TypeError: "'NoneType' object is not callable" in <bound method Native
Function.del of <calibre_plugins.dedrm.adobekey.NativeFunction object at 0x0
000000003DF4E10>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method Native
Function.del of <calibre_plugins.dedrm.adobekey.NativeFunction object at 0x0
000000003DF4CC0>> ignored

@apprenticeharper
Copy link
Owner

And as expected, I can't reproduce with calibre 2.4.0 and DeDRM 6.3.4 either.

C:\Users\Harper>calibre-debug -g
calibre 2.40 [64bit] isfrozen: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Successfully initialized third party plugins: DeDRM && Obok DeDRM
Registering with default programs...
Starting up...
Upgrading database to version 22...
DEBUG: 0.0 obok::utilities.py - loading translations
DEBUG: 0.0 obok::dialogs.py - loading translations
DEBUG: 0.0 obok::config.py - loading translations
DEBUG: 0.1 using xml.etree for xml parsing
DEBUG: 0.1 obok::action_err.py - loading translations
Registered with default programs in 3.7 seconds
Started up in 6.46 seconds with 8 books
DeDRM v6.3.4: Trying to decrypt Floating Gold A Natural (and Unnatural) History
of Ambergris.epub
DeDRM v6.3.4: Verifying zip archive integrity
DeDRM v6.3.4: Floating Gold A Natural (and Unnatural) History of Ambergris.epub
is a secure Adobe Adept ePub
DeDRM v6.3.4: Trying Encryption key other_key
DeDRM v6.3.4: Exception when decrypting after 0.5 seconds
Traceback (most recent call last):
File "calibre_plugins.dedrm.init", line 293, in ePubDecrypt
File "calibre_plugins.dedrm.ineptepub", line 398, in decryptBook
File "calibre_plugins.dedrm.ineptepub", line 313, in init
File "calibre_plugins.dedrm.ineptepub", line 290, in getChild
File "calibre_plugins.dedrm.ineptepub", line 227, in get
ASN1Error: Error decoding ASN.1
DeDRM v6.3.4: Failed to decrypt with key other_key after 0.5 seconds
DeDRM v6.3.4: Trying Encryption key default_key
DeDRM v6.3.4: Finished after 2.6 seconds
Added Floating Gold: A Natural (and Unnatural) History of Ambergris to db in: 0.
5
Added 1 books in 5.6 seconds

@apprenticeharper
Copy link
Owner

Since I don't have a Linux-based machine, I don't think there's a lot more that I can do. But if you could post a full log, I could try to spot some way to catch the error and allow the further keys to be used. (The snippets you've posted so far give no context as to when the error happens.)

I suspect that the error is actually down to the particular variety and version of Linux you have.

@clayote
Copy link
Author

clayote commented Nov 1, 2015

sanotehu@sanotehu-P1801:~/src/LiSE$ which calibre-debug
/usr/bin/calibre-debug
sanotehu@sanotehu-P1801:~/src/LiSE$ calibre-debug -g
calibre 2.33  isfrozen: False is64bit: True
Linux-4.2.0-16-generic-x86_64-with-Ubuntu-15.10-wily Linux ('64bit', 'ELF')
('Linux', '4.2.0-16-generic', '#19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015')
Python 2.7.10
Linux: ('Ubuntu', '15.10', 'wily')
Successfully initialized third party plugins: DeDRM
Starting up...
Started up in 1.82 seconds with 289 books
KSambaShare: Could not find smb.conf!
DeDRM v6.3.4: Trying to decrypt The_Annihilation_Score_0001.epub
DeDRM v6.3.4: Verifying zip archive integrity
DeDRM v6.3.4: The_Annihilation_Score_0001.epub is a secure Adobe Adept ePub
DeDRM v6.3.4: Trying Encryption key calibre-adeptkey

and then, as above.

I didn't think that would be very helpful but there you go ...

@apprenticeharper
Copy link
Owner

Thanks. It is, at least, helpful in a negative way - there's nothing obvious in there that's causing a problem.

So, a closer look at the error:

No node found for item that was just removed: QUrl( "file:///home/sanotehu/Documents/My Digital Editions/manifest.xml" )

Clearly something to do with Adobe Digital Editions, but nothing that the DeDRM plugin code is referencing. A puzzle indeed.

I'll see if I can add some more error handling to get both keys tried no matter what's throwing the error.

@apprenticeharper
Copy link
Owner

OK, I have a test version for you to try. Please email me directly, apprenticeharper@gmail.com and I'll send it to you.

@apprenticeharper
Copy link
Owner

I don't seem to have received an email from you. If you are still having problems, let me know by email and I'll re-open this issue.

@Evidlo
Copy link

Evidlo commented Jan 29, 2020

I'm also seeing this issue with DeDRM 6.6.3 and Calibre 3.36.

@ElleKayEm
Copy link

Post a log if you want someone to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants