def _challenge(self, node): encryption = Encryption(self.number, self.secret, node.data) self.writer.encrypt = encryption.encrypt self.reader.decrypt = encryption.decrypt logger.debug("Session Key: %s", encryption.export_key()) response = Node("response", xmlns="urn:ietf:params:xml:ns:xmpp-sasl", data=encryption.get_response()) self._write(response, encrypt=False) self._incoming()
def _challenge(self, node): encryption = Encryption(self.secret, node.data) logger.debug("Session Keys: %s", [key.encode("hex") for key in encryption.keys]) self.writer.encrypt = encryption.encrypt self.reader.decrypt = encryption.decrypt data = "%s%s%s" % (self.number, node.data, utils.timestamp()) response = Node("response", data=encryption.encrypt(data, False)) self._write(response, encrypt=False) self._incoming()
def _challenge(self, node): encryption = Encryption(self.secret, node.data) logger.debug( "Session Keys: %s", [key.encode("hex") for key in encryption.keys]) self.writer.encrypt = encryption.encrypt self.reader.decrypt = encryption.decrypt data = "%s%s%s" % (self.number, node.data, utils.timestamp()) response = Node("response", data=encryption.encrypt(data, False)) self._write(response, encrypt=False) self._incoming()