def handlePreSendRequestNoCrypt(self, socket, request): if (request.guid in self.peers) and self.peers[request.guid].sharedPassword: preSendRequest = JSONToObject(PreSendRequestNoCrypt, request.data) if askForConfirmation(self.parent, "Accept file " + preSendRequest.fileName + " from " + self.peers[ request.guid].name + " over insecure connection?"): self.preSendRegistrationsNoCrypt[request.guid] = preSendRequest socket.send(RESPONSE_OK) else: socket.send(RESPONSE_REJECT) else: socket.send(RESPONSE_NOT_PAIRED)
def handlePreSendRequest(self, socket, request): if (request.guid in self.peers) and self.peers[request.guid].sharedPassword: preSendRequest = JSONToObject(PreSendRequest, request.data) if not preSendRequest.publicKey.verifySignature(self.peers[request.guid].sharedPassword): socket.send(RESPONSE_BAD_SIGNATURE) return if askForConfirmation(self.parent, "Accept file " + preSendRequest.fileName + " from " + self.peers[ request.guid].name + "?"): self.preSendRegistrations[request.guid] = preSendRequest socket.send(RESPONSE_OK) else: socket.send(RESPONSE_REJECT) else: socket.send(RESPONSE_NOT_PAIRED)