mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2024-12-29 12:47:41 +06:00
Fix loading libcrypto on OSX Big Sur
It looks like Big Sur removed `libcrypto.dylib` as a file on the filesystem, so loading it using `ctypes.find_library` fails which breaks Kindle decryption. Now to load a dylib you need to attempt to load it directly and the operating system will load the dylib from the OS' cache or fail. This fixes the problem by explicitly setting the path to libcrypto to `/usr/lib/libcrypto.dylib` if `ctypes.find_library` does not find the file, loading the dylib and raising an exception if it fails at that point. See saltstack/salt#5778 for more detailed info. Closes #1369.
This commit is contained in:
parent
4868a7460e
commit
cdab22e59c
@ -1183,8 +1183,12 @@ elif isosx:
|
||||
|
||||
libcrypto = find_library('crypto')
|
||||
if libcrypto is None:
|
||||
raise DrmException(u"libcrypto not found")
|
||||
libcrypto = CDLL(libcrypto)
|
||||
libcrypto = '/usr/lib/libcrypto.dylib'
|
||||
try:
|
||||
libcrypto = CDLL(libcrypto)
|
||||
except Exception as e:
|
||||
raise DrmException(u"libcrypto not found: " % e)
|
||||
|
||||
|
||||
# From OpenSSL's crypto aes header
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user