[Simo Sorce] fix GSSAPI to use FQDN. See #2465
This commit is contained in:
parent
961e4426ff
commit
91cc491173
|
@ -146,8 +146,9 @@ class SASL(PlugIn):
|
|||
def MechanismHandler(self):
|
||||
if "GSSAPI" in self.mecs and have_kerberos:
|
||||
self.mecs.remove("GSSAPI")
|
||||
rc, self.gss_vc = kerberos.authGSSClientInit('xmpp@' +
|
||||
self._owner.Server)
|
||||
rc, self.gss_vc = kerberos.authGSSClientInit('xmpp@' +
|
||||
self._owner.socket._hostfqdn)
|
||||
rc = kerberos.authGSSClientStep(self.gss_vc, '')
|
||||
response = kerberos.authGSSClientResponse(self.gss_vc)
|
||||
node=Node('auth',attrs={'xmlns': NS_SASL, 'mechanism': 'GSSAPI'},
|
||||
payload=(response or ""))
|
||||
|
@ -205,7 +206,7 @@ class SASL(PlugIn):
|
|||
incoming_data = challenge.getData()
|
||||
data=base64.decodestring(incoming_data)
|
||||
self.DEBUG('Got challenge:'+data,'ok')
|
||||
if self.mechanism == "GSSAPI":
|
||||
if self.mechanism == 'GSSAPI':
|
||||
if self.gss_step == GSS_STATE_STEP:
|
||||
rc = kerberos.authGSSClientStep(self.gss_vc, incoming_data)
|
||||
if rc != kerberos.AUTH_GSS_CONTINUE:
|
||||
|
@ -214,7 +215,7 @@ class SASL(PlugIn):
|
|||
rc = kerberos.authGSSClientUnwrap(self.gss_vc, incoming_data)
|
||||
response = kerberos.authGSSClientResponse(self.gss_vc)
|
||||
rc = kerberos.authGSSClientWrap(self.gss_vc, response,
|
||||
self.username)
|
||||
kerberos.authGSSClientUserName(self.gss_vc))
|
||||
response = kerberos.authGSSClientResponse(self.gss_vc)
|
||||
if not response:
|
||||
response = ''
|
||||
|
|
|
@ -246,6 +246,7 @@ class NonBlockingTcp(PlugIn, IdleObject):
|
|||
self._exported_methods=[self.send, self.disconnect, self.onreceive, self.set_send_timeout,
|
||||
self.start_disconnect, self.set_timeout, self.remove_timeout]
|
||||
self._server = server
|
||||
self._hostfqdn = server[0]
|
||||
self.on_connect = on_connect
|
||||
self.on_connect_failure = on_connect_failure
|
||||
self.on_receive = None
|
||||
|
@ -304,6 +305,7 @@ class NonBlockingTcp(PlugIn, IdleObject):
|
|||
server=self._server
|
||||
else:
|
||||
self._server = server
|
||||
self._hostfqdn = self._server[0]
|
||||
self.printed_error = False
|
||||
self.state = 0
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue