Skip to content
Snippets Groups Projects
Commit c271d1f1 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

fix bad indentation

parent 3392c54d
No related branches found
No related tags found
No related merge requests found
...@@ -63,10 +63,10 @@ class NonSASL(PlugIn): ...@@ -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): ...@@ -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): ...@@ -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: ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment