def respond_pubkey_if_mine(self, nickname, ident_pubkey): if ident_pubkey != self.pubkey: self._log.info("Public key does not match your identity") return # Return signed pubkey pubkey = self._myself.get_pubkey() ec_key = obelisk.EllipticCurveKey() ec_key.set_secret(self.secret) digest = obelisk.Hash(pubkey) signature = ec_key.sign(digest) # Send array of nickname, pubkey, signature to transport layer self.send(proto_response_pubkey(nickname, pubkey, signature))
def respond_pubkey_if_mine(self, nickname, ident_pubkey): if ident_pubkey != PUBKEY: print "Public key does not match your identity" return # Return signed pubkey pubkey = self._myself.get_pubkey() ec_key = obelisk.EllipticCurveKey() ec_key.set_secret(SECRET) digest = obelisk.Hash(pubkey) signature = ec_key.sign(digest) # Send array of nickname, pubkey, signature to transport layer self.send(proto_response_pubkey(nickname, pubkey, signature))
def respond_pubkey_if_mine(self, nickname, ident_pubkey): if ident_pubkey != self.pubkey: self.log.info("Public key does not match your identity") return # Return signed pubkey pubkey = self.cryptor.pubkey # XXX: A Cryptor does not have such a field. ec_key = obelisk.EllipticCurveKey() ec_key.set_secret(self.secret) digest = obelisk.Hash(pubkey) signature = ec_key.sign(digest) # Send array of nickname, pubkey, signature to transport layer self.send(proto_response_pubkey(nickname, pubkey, signature))