Skip to content

Commit 2c8ca66

Browse files
author
RemideZ
committed
Update openssl.py
1 parent 8df9dc5 commit 2c8ca66

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pyelliptic/openssl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ def __init__(self, library):
289289
self.HMAC.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int,
290290
ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p]
291291

292-
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
292+
try:
293+
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
294+
except:
295+
# The above is not compatible with all versions of OSX.
296+
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC_SHA1
297+
293298
self.PKCS5_PBKDF2_HMAC.restype = ctypes.c_int
294299
self.PKCS5_PBKDF2_HMAC.argtypes = [ctypes.c_void_p, ctypes.c_int,
295300
ctypes.c_void_p, ctypes.c_int,

0 commit comments

Comments
 (0)