def handleSignedBucketResponse(self, result, node, challenge):
        logger(self.sourceNode, "handleSignedBucketResponse {}".format(str(result)))
        nodeIdHex = node.id.encode('hex').upper()
        if result[0]:
            if "NACK" in result[1]:
                return (False, self.handleSignedNACKResponse(result, node, challenge))
            elif 'bucket' in result[1] and 'signature' in result[1]:
                cert_stored = self.searchForCertificate(nodeIdHex)
                if cert_stored == None:
                    logger(self.sourceNode,
                           "RETFALSENONE: Certificate for sender of bucket:"
                           " {} not present in store".format(node))
                    return (False, None)
                try:
                    OpenSSL.crypto.verify(cert_stored,
                                         result[1]['signature'],
                                         challenge,
                                         "sha256")
                    self.router.addContact(node)
                    newbucket = list()
                    for bucketnode in result[1]['bucket']:
                        buId = bucketnode[0]
                        buIdHex = buId.encode('hex').upper()
                        buIp = bucketnode[1]
                        buPort = bucketnode[2]
                        if not self.certificateExists(buIdHex):
                            nonCertifiedNode = Node(buId,
                                                    buIp,
                                                    buPort)
                            buIdDigest = digest(str(buIdHex))
                            buIdReq = "{}cert".format(Node(buIdDigest))
                            self.callCertFindValue(nonCertifiedNode,
                                                  buIdReq)
                        else:
                            newbucket.append(bucketnode)
                    return (result[0], newbucket)
                except:
                    logger(self.sourceNode,
                          "RETFALSENONE: Bad signature for"
                          " sender of bucket: {}".format(node))
                    return (False, None)
            else:
                if not result[1]['signature']:
                    logger(self.sourceNode,
                          "RETFALSENONE: Signature not present"
                          " for sender of bucket: {}".format(node))
                return (False, None)
        else:
            logger(self.sourceNode,
                  "RETFALSENONE: No response from {},"
                  " removing from bucket".format(node))
            self.router.removeContact(node)
        return (False, None)
???
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/south/plugins/storage/twistedimpl/securedht/append_server.py/KademliaProtocolAppend.handleSignedBucketResponse