Closed rossohill closed 2 years ago
I can confirm this on a Pop!_OS 22.04 system with Calibre 5.37. System Python is 3.10.
Both libadobe and oscrypto come with the plugin, so I'm confused as to why it wouldn't be able to find them ... You did download the "DeACSM_0.0.15.zip" file from the release page, not the source code bundle?
The issue on PopOS 22.04 or any system based on Ubuntu 22.04 is a known issue with OpenSSL 3.0 which will be fixed with the next release of this plugin.
Can you test the latest change in commit b9f6672a4c0a55f6da17031f4b3492d835ed8a99 (download link https://github.com/Leseratte10/acsm-calibre-plugin/suites/6333118833/artifacts/227911219 )?
That should fix the issue on Ubuntu 22.04, maybe it also fixes the issue on Windows. I don't yet have a machine with Ubuntu 22.04 so I can't easily test this myself.
It installed but I was unable to add an acsm book. Do I need to completely reinitialize DeACSM?
I completedly deleted DeACSM and reinstalled it and when I tried to create an anonymous authorization, I got the following error:
calibre 5.37 embedded-python: False is64bit: True
Linux-5.16.19-76051619-generic-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.16.19-76051619-generic', '#202204081339~1649696161~22.04~091f44b SMP PREEMPT Mon Apr 11 17')
Python 3.10.4
Interface language: None
Successfully initialized third party plugins: DeACSM (0, 0, 15) && DeDRM (10, 0, 2)
Traceback (most recent call last):
File "calibre_plugins.deacsm.config", line 1032, in create_anon_auth
success, resp = activateDevice(idx, None)
File "/home/user/.config/calibre/plugins/DeACSM.zip/libadobeAccount.py", line 828, in activateDevice
signature = sign_node(req_xml)
File "/home/user/.config/calibre/plugins/DeACSM.zip/libadobe.py", line 518, in sign_node
my_priv_key, _, _ = keys.parse_pkcs12(my_pkcs12, base64.b64encode(devkey_bytes))
File "/home/user/.config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/asymmetric.py", line 800, in parse_pkcs12
return _parse_pkcs12(data, password, load_private_key)
File "/home/user/.config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 868, in _parse_pkcs12
decrypted_content = _decrypt_encrypted_data(encryption_algorithm_info, encrypted_content, password)
File "/home/user/.config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 1038, in _decrypt_encrypted_data
plaintext = decrypt_func(enc_key, encrypted_content, enc_iv)
File "/home/user/.config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/symmetric.py", line 358, in rc2_cbc_pkcs5_decrypt
raise EnvironmentError('OpenSSL has been compiled without RC2 support')
OSError: OpenSSL has been compiled without RC2 support
Damnit. Looks like Ubuntu 22.04 completely dropped support for that ancient encryption Adobe uses. I've opened a bug report in the oscrypto repo asking its developer for clarification ( https://github.com/wbond/oscrypto/issues/60 ), but if I'm reading the code correctly, I'll have to find a different solution for that pkcs12 parsing ...
Okay, I've set up a workaround that seems to work for me, now I just need to make sure it doesn't break older Linuxes and then I can add that until oscrypto is fixed.
Let me know if there is anything I can do to help. Thank you for your work on this awesome plugin!
Managed to fix the root cause of the issue in the oscrypto library: https://github.com/wbond/oscrypto/pull/61 I'm going to wait a couple days and see if that gets merged / fixed in oscrypto (then I can just use the new release), otherwise I'm going to include a patched version of oscrypto in my plugin as a temporary fix until this PR gets merged. Thanks for the reports and logs.
Can you test the latest change in commit b9f6672 (download link https://github.com/Leseratte10/acsm-calibre-plugin/suites/6333118833/artifacts/227911219 )?
That should fix the issue on Ubuntu 22.04, maybe it also fixes the issue on Windows. I don't yet have a machine with Ubuntu 22.04 so I can't easily test this myself.
Tested yesterday : OK I have an error message in the plugin GUI while trying to access to the Options. I just read and removed some (2 or 3) bad characters from the end of an options XML Then all works fine again with the artficats proposed for testing purpose !
calibre (calibre 5.42)
Thanks
@zoof As my change to the oscrypto library still hasn't been merged, I modded the plugin so that it patches the library itself. As of d66913c1aed97148fa9d617a9e15ca83ad120ab6 the plugin should now work with Ubuntu 22.04.
If you had previously installed an older version of the plugin on Ubuntu 22.04, it might take two restarts of Calibre after the update until the plugin works properly. If it's a fresh install of the plugin, one restart should be enough.
Thank you! It works for me now.
Thanks for the response. The fix will be included in the next release then (either with the current workaround or with the updated library), so I'm going to close this issue.
Bug description
"Invalid Plugin" error when attempting to import plugin, first time installing. Looks like there are two modules it can't find, libadobe and oscrypto. Error message:
Thanks for your time.
Operating system
Windows
Which version of Calibre are you running?
v5.41.0
Which version of the DeACSM plugin are you running?
v0.0.15
Further information
No response