feat: make libcrypto and libssl paths overrideable

It is necessary to properly use this plugin on NixOS and also allows
overriding for testing & other purposes.
This commit is contained in:
Nydragon 2024-06-12 19:29:42 +09:00 committed by Florian Bach
parent 27bd9531c4
commit 25a395f128

View File

@ -285,6 +285,20 @@ class ACSMInput(FileTypePlugin):
# Okay, now all the modules are available, import the Adobe modules. # Okay, now all the modules are available, import the Adobe modules.
# Crucial to import first, as libadobe imports oscrypto as well
libcrypto_path = os.environ["ACSM_LIBCRYPTO"]
libssl_path = os.environ["ACSM_LIBSSL"]
if os.path.exists(libcrypto_path) and os.path.exists(libssl_path):
import oscrypto
oscrypto.use_openssl(
libcrypto_path = libcrypto_path,
libssl_path = libssl_path,
)
from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
from libadobeAccount import createDeviceFile, createUser, signIn, activateDevice from libadobeAccount import createDeviceFile, createUser, signIn, activateDevice
from libadobeFulfill import buildRights, fulfill from libadobeFulfill import buildRights, fulfill