Пример #1
0
 def _reply_trc(self, key, req_info):
     isd, ver = key
     ver = None if ver == TRCRequest.NEWEST_VERSION else ver
     meta = req_info[0]
     trc = self.trust_store.get_trc(isd, ver)
     self.send_meta(CtrlPayload(CertMgmt(TRCReply.from_values(trc))), meta)
     logging.info("TRC for %sv%s sent to %s", isd, ver, meta)
Пример #2
0
 def _reply_trc(self, key, info):
     isd, ver = key
     meta = info[0]
     dst = meta.get_addr()
     port = meta.port
     trc = self.trust_store.get_trc(isd, ver)
     self._send_reply(dst, port, TRCReply.from_values(trc))
     logging.info("TRC for %sv%s sent to %s:%s", isd, ver, dst, port)
Пример #3
0
 def _cached_trcs_handler(self, raw_entries):
     """
     Handles cached (through ZK) TRCs, passed as a list.
     """
     for raw in raw_entries:
         trc = TRC.from_raw(raw.decode('utf-8'))
         rep = TRCReply.from_values(trc)
         self.process_trc_reply(rep, None, from_zk=True)
     logging.debug("Processed %s trcs from ZK", len(raw_entries))
Пример #4
0
 def process_trc_request(self, req, meta):
     """Process a TRC request."""
     assert isinstance(req, TRCRequest)
     isd, ver = req.isd_as()[0], req.p.version
     logging.info("TRC request received for %sv%s from %s" % (isd, ver, meta))
     trc = self.trust_store.get_trc(isd, ver)
     if trc:
         self.send_meta(TRCReply.from_values(trc), meta)
     else:
         logging.warning("Could not find requested TRC %sv%s" % (isd, ver))
Пример #5
0
 def process_trc_request(self, cpld, meta):
     """Process a TRC request."""
     cmgt = cpld.union
     req = cmgt.union
     assert isinstance(req, TRCRequest), type(req)
     isd, ver = req.isd_as()[0], req.p.version
     logging.info("TRC request received for %sv%s from %s [id: %s]" %
                  (isd, ver, meta, cpld.req_id_str()))
     trc = self.trust_store.get_trc(isd, ver)
     if trc:
         self.send_meta(
             CtrlPayload(CertMgmt(TRCReply.from_values(trc)), req_id=cpld.req_id),
             meta)
     else:
         logging.warning("Could not find requested TRC %sv%s [id: %s]" %
                         (isd, ver, cpld.req_id_str()))
Пример #6
0
 def _reply_trc(self, key, req_info):
     isd, ver = key
     meta = req_info[0]
     trc = self.trust_store.get_trc(isd, ver)
     self.send_meta(TRCReply.from_values(trc), meta)
     logging.info("TRC for %sv%s sent to %s", isd, ver, meta)
Пример #7
0
 def _reply_trc(self, key, info):
     isd, ver = key
     src, port, _ = info
     trc = self.trust_store.get_trc(isd, ver)
     self._send_reply(src, port, TRCReply.from_values(trc))
     logging.info("TRC for %sv%s sent to %s:%s", isd, ver, src, port)