acsm-calibre-plugin
acsm-calibre-plugin copied to clipboard
Exception when installing plugin in Flatpak Calibre
Bug description
When trying to import the plugin, Calibre installed via Flatpak shows the following exception:
Traceback (most recent call last):
File "calibre/customize/ui.py", line 710, in initialize_plugin
File "calibre_plugins.deacsm.__init__", line 226, in initialize
from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
File "/home/mara/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in <module>
from oscrypto import keys
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in <module>
from ._asymmetric import parse_certificate, parse_private, parse_public
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in <module>
from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in <module>
from .util import rand_bytes
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 14, in <module>
from ._openssl.util import rand_bytes
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/util.py", line 6, in <module>
from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in <module>
from ._libcrypto_ctypes import (
File "/home/mara/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 47, in <module>
raise LibraryNotFoundError('Error detecting the version of libcrypto')
oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto
This appears due to a bug in oscrypto with libssl version numbers that contain multiple digits (the runtime used by the Calibre Flatpak currently has OpenSSL 3.0.10). This was fixed in oscrypto (https://github.com/wbond/oscrypto/commit/d5f3437ed24257895ae1edd9e503cfb352e635a8) but not yet included in a release (https://github.com/wbond/oscrypto/issues/78).
Would it be possible to make a new release of DeACSM with a fixed bundled version of oscrypto?
Operating system
Linux
Which version of Calibre are you running?
6.26
Which version of the ACSM Input plugin are you running?
v0.0.16
Import type
No response
Further information
No response
I can confirm that DeACSM doesn't work with flatpak calibre, that's why I have reported this: https://github.com/flathub/com.calibre_ebook.calibre/issues/189
I can confirm that this workaround worked:
- Download DeACSM v0.0.16
- git clone https://github.com/wbond/oscrypto
- zip -r oscypto.zip oscrypto
- unzip DeACSM
- replace oscrypto.zip
- zip it up again
Then I could install the plugin in flatpak calibre.
This has nothing to do with Flatpak vs. non Flatpak. This is a bug in oscrypto that causes it to fail with OpenSSL 3.0.10 and newer. I'll try to add another patch for that later.
Experiencing the same here.