fix bad indentation
This commit is contained in:
parent
3392c54dd0
commit
c271d1f15a
|
@ -63,10 +63,10 @@ class NonSASL(PlugIn):
|
||||||
self.DEBUG("Performing zero-k authentication",'ok')
|
self.DEBUG("Performing zero-k authentication",'ok')
|
||||||
|
|
||||||
def hasher(s):
|
def hasher(s):
|
||||||
return sha.new(s).hexdigest()
|
return sha.new(s).hexdigest()
|
||||||
|
|
||||||
def hash_n_times(s, count):
|
def hash_n_times(s, count):
|
||||||
return count and hasher(hash_n_times(s, count-1)) or s
|
return count and hasher(hash_n_times(s, count-1)) or s
|
||||||
|
|
||||||
hash_ = hash_n_times(hasher(hasher(self.password)+token), int(seq))
|
hash_ = hash_n_times(hasher(hasher(self.password)+token), int(seq))
|
||||||
query.setTagData('hash', hash_)
|
query.setTagData('hash', hash_)
|
||||||
|
|
|
@ -284,11 +284,11 @@ class Component(CommonClient):
|
||||||
self.Server=server[0]
|
self.Server=server[0]
|
||||||
CommonClient.connect(self,server=server,proxy=proxy)
|
CommonClient.connect(self,server=server,proxy=proxy)
|
||||||
if self.connected and (self.typ=='jabberd2' or not self.typ and self.Dispatcher.Stream.features is not None):
|
if self.connected and (self.typ=='jabberd2' or not self.typ and self.Dispatcher.Stream.features is not None):
|
||||||
self.defaultNamespace=auth.NS_CLIENT
|
self.defaultNamespace=auth.NS_CLIENT
|
||||||
self.Dispatcher.RegisterNamespace(self.defaultNamespace)
|
self.Dispatcher.RegisterNamespace(self.defaultNamespace)
|
||||||
self.Dispatcher.RegisterProtocol('iq',dispatcher.Iq)
|
self.Dispatcher.RegisterProtocol('iq',dispatcher.Iq)
|
||||||
self.Dispatcher.RegisterProtocol('message',dispatcher.Message)
|
self.Dispatcher.RegisterProtocol('message',dispatcher.Message)
|
||||||
self.Dispatcher.RegisterProtocol('presence',dispatcher.Presence)
|
self.Dispatcher.RegisterProtocol('presence',dispatcher.Presence)
|
||||||
return self.connected
|
return self.connected
|
||||||
|
|
||||||
def auth(self,name,password,dup=None,sasl=0):
|
def auth(self,name,password,dup=None,sasl=0):
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Commands(PlugIn):
|
||||||
conn.send(Error(request,ERR_ITEM_NOT_FOUND))
|
conn.send(Error(request,ERR_ITEM_NOT_FOUND))
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
elif node in self._handlers['']:
|
elif node in self._handlers['']:
|
||||||
self._handlers[''][node]['execute'](conn,request)
|
self._handlers[''][node]['execute'](conn,request)
|
||||||
else:
|
else:
|
||||||
conn.send(Error(request,ERR_ITEM_NOT_FOUND))
|
conn.send(Error(request,ERR_ITEM_NOT_FOUND))
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
|
|
|
@ -135,7 +135,7 @@ class netgrowl:
|
||||||
checksum = md5.new()
|
checksum = md5.new()
|
||||||
checksum.update(data)
|
checksum.update(data)
|
||||||
if self.password:
|
if self.password:
|
||||||
checksum.update(self.password)
|
checksum.update(self.password)
|
||||||
data += checksum.digest()
|
data += checksum.digest()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue