Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mech[name] = impl
mechmap[name] = basescore + n
class error:
def __init__( self, sasl, txt, mech=None ):
self.sasl = sasl
self.txt = txt
self.mech = mech
def __str__( self ):
if self.mech is None:
return "SASL Error for " + "something here" + ": " + self.txt
else:
return "SASL Error for " + "something here" + ", mechanism " + self.mech.mechname + ": " + self.txt
class cancelled(error):
def __init__( self, sasl, mech=None ):
error.__init__( self, sasl, "User cancelled", mech )
_answers = {}
class sasl:
def __init__( self, host, service, mech=None, username=None, min=0, callback=None, secquery=None, tls_active=None, defrealm=None ):
self.defrealm = defrealm or host
self.service = service
self.host = host
self.stash_id = None
self.testkey = None
self.user = None
self.mech = mech
if username is not None:
self.reset_stash_id( username )