Navigation Menu

Skip to content

Commit

Permalink
Allow GSS to work with older version of kerberos library
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-tr-adamson committed Jan 5, 2015
1 parent e54d2e1 commit 6249ccd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions puresasl/mechanisms.py
Expand Up @@ -452,8 +452,14 @@ def __init__(self, sasl, principal=None, **props):
self._fetch_properties('host', 'service')

krb_service = b'@'.join((bytes(self.service), bytes(self.host)))
_, self.context = kerberos.authGSSClientInit(
service=krb_service, principal=self.principal)
try:
_, self.context = kerberos.authGSSClientInit(
service=krb_service, principal=self.principal)
except TypeError:
if self.principal is not None:
raise StandardError("Error: kerberos library does not support principal.")
_, self.context = kerberos.authGSSClientInit(
service=krb_service)

def process(self, challenge=None):
if not self._have_negotiated_details:
Expand Down

0 comments on commit 6249ccd

Please sign in to comment.