Skip to content

Commit

Permalink
Fix oscrypto support for libcrypto.35.dylib and libssl.35.dylib
Browse files Browse the repository at this point in the history
It seems certain version pairs have to be used together, but Apple
doesn't really publish this info, and it is harder to figure out now
that system dylibs aren't show in the filesystem.

The other known good pair is libcrypto.42.dylib and libssl.44.dylib.
  • Loading branch information
wbond committed Oct 17, 2022
1 parent 4197348 commit e90100e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions oscrypto/_openssl/_libssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ class LibsslConst():
LibsslConst.SSL_R_DH_KEY_TOO_SMALL = 394


error_code_version_info = libcrypto_version_info
# The Apple version of libssl seems to have changed various codes for
# some reason, but the rest of the API is still OpenSSL 1.0.1
if sys.platform == 'darwin' and re.match(r'/usr/lib/libssl\.\d', _backend_config().get('libssl_path', '')):
LibsslConst.SSL_F_TLS_PROCESS_SERVER_CERTIFICATE = 7
LibsslConst.SSL_F_SSL3_GET_KEY_EXCHANGE = 9
LibsslConst.SSL_F_SSL3_READ_BYTES = 4
LibsslConst.SSL_F_SSL3_GET_RECORD = 4
LibsslConst.SSL_F_SSL23_GET_SERVER_HELLO = 4
error_code_version_info = (1, 1, 0)

else:
error_code_version_info = libcrypto_version_info
if sys.platform == 'darwin':
libssl_abi_match = re.match(r'/usr/lib/libssl\.(\d+)', _backend_config().get('libssl_path', ''))
if libssl_abi_match and int(libssl_abi_match.group(1)) >= 44:
LibsslConst.SSL_F_TLS_PROCESS_SERVER_CERTIFICATE = 7
LibsslConst.SSL_F_SSL3_GET_KEY_EXCHANGE = 9
LibsslConst.SSL_F_SSL3_READ_BYTES = 4
LibsslConst.SSL_F_SSL3_GET_RECORD = 4
LibsslConst.SSL_F_SSL23_GET_SERVER_HELLO = 4
error_code_version_info = (1, 1, 0)

0 comments on commit e90100e

Please sign in to comment.