Skip to content

Commit

Permalink
Fix DCE symbol name logic on macOS
Browse files Browse the repository at this point in the history
Only use the private Apple symbol name for the DCE extension detection
when using the actual GSS.Framework target. This will allow compiling
this library against a custom MIT krb5 or Heimdal library on macOS with
support for the normal IOV wrapping functions.

Signed-off-by: Jordan Borean <[email protected]>
  • Loading branch information
jborean93 committed Aug 27, 2024
1 parent 6e0b6b1 commit cf9a337
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def get_output(*args, **kwargs):
ENABLE_SUPPORT_DETECTION = \
(os.environ.get('GSSAPI_SUPPORT_DETECT', 'true').lower() == 'true')

wrap_iov_symbol_name = 'gss_wrap_iov'
if ENABLE_SUPPORT_DETECTION:
import ctypes.util

Expand Down Expand Up @@ -205,6 +206,9 @@ def get_output(*args, **kwargs):

GSSAPI_LIB = ctypes.CDLL(os.path.join(main_path, main_lib))

if hasattr(GSSAPI_LIB, '__ApplePrivate_gss_wrap_iov'):
wrap_iov_symbol_name = '__ApplePrivate_gss_wrap_iov'


def make_extension(name_fmt, module, **kwargs):
"""Helper method to remove the repetition in extension declarations."""
Expand Down Expand Up @@ -323,9 +327,7 @@ def gssapi_modules(lst):
extension_file('rfc5588', 'gss_store_cred'),
extension_file('rfc5801', 'gss_inquire_saslname_for_mech'),
extension_file('cred_imp_exp', 'gss_import_cred'),
extension_file('dce',
'__ApplePrivate_gss_wrap_iov' if osx_has_gss_framework
else 'gss_wrap_iov'),
extension_file('dce', wrap_iov_symbol_name),
extension_file('dce_aead', 'gss_wrap_aead'),
extension_file('iov_mic', 'gss_get_mic_iov'),
extension_file('ggf', 'gss_inquire_sec_context_by_oid'),
Expand Down

0 comments on commit cf9a337

Please sign in to comment.