Beispiel #1
0
 def _reply_cc(self, key, req_info):
     isd_as, ver = key
     ver = None if ver == CertChainRequest.NEWEST_VERSION else ver
     meta = req_info[0]
     cert_chain = self.trust_store.get_cert(isd_as, ver)
     self.send_meta(CtrlPayload(CertMgmt(CertChainReply.from_values(cert_chain))), meta)
     logging.info("Cert chain for %sv%s sent to %s", isd_as, ver, meta)
Beispiel #2
0
 def _reply_cc(self, key, info):
     isd_as, ver = key
     src, port = info
     cert_chain = self.trust_store.get_cert(isd_as, ver)
     self._send_reply(src, port, CertChainReply.from_values(cert_chain))
     logging.info("Cert chain for %sv%s sent to %s:%s", isd_as, ver, src,
                  port)
Beispiel #3
0
 def _reply_cc(self, key, meta):
     isd_as, ver = key
     dst = meta.get_addr()
     port = meta.port
     cert_chain = self.trust_store.get_cert(isd_as, ver)
     self._send_reply(dst, port, CertChainReply.from_values(cert_chain))
     logging.info("Cert chain for %sv%s sent to %s:%s", isd_as, ver, dst,
                  port)
Beispiel #4
0
 def _cached_certs_handler(self, raw_entries):
     """
     Handles cached (through ZK) chains, passed as a list.
     """
     for raw in raw_entries:
         cert = CertificateChain.from_raw(raw.decode('utf-8'))
         rep = CertChainReply.from_values(cert)
         self.process_cert_chain_reply(rep, None, from_zk=True)
     logging.debug("Processed %s certs from ZK", len(raw_entries))
Beispiel #5
0
 def _reply_cc(self, key, req_info):
     isd_as, ver = key
     meta = req_info[0]
     req_id = req_info[2]
     cert_chain = self.trust_store.get_cert(isd_as, ver)
     self.send_meta(
         CtrlPayload(CertMgmt(CertChainReply.from_values(cert_chain)),
                     req_id=req_id), meta)
     logging.info("Cert chain for %sv%s sent to %s [id: %016x]", isd_as,
                  ver, meta, req_id)
Beispiel #6
0
 def process_cert_chain_request(self, req, meta):
     """Process a certificate chain request."""
     assert isinstance(req, CertChainRequest)
     isd_as, ver = req.isd_as(), req.p.version
     logging.info("Cert chain request received for %sv%s from %s" % (isd_as, ver, meta))
     cert = self.trust_store.get_cert(isd_as, ver)
     if cert:
         self.send_meta(CertChainReply.from_values(cert), meta)
     else:
         logging.warning("Could not find requested certificate %sv%s" %
                         (isd_as, ver))
Beispiel #7
0
 def process_cert_chain_request(self, cpld, meta):
     """Process a certificate chain request."""
     cmgt = cpld.union
     req = cmgt.union
     assert isinstance(req, CertChainRequest), type(req)
     isd_as, ver = req.isd_as(), req.p.version
     logging.info("Cert chain request received for %sv%s from %s [id: %s]" %
                  (isd_as, ver, meta, cpld.req_id_str()))
     cert = self.trust_store.get_cert(isd_as, ver)
     if cert:
         self.send_meta(
             CtrlPayload(CertMgmt(CertChainReply.from_values(cert)), req_id=cpld.req_id),
             meta)
     else:
         logging.warning("Could not find requested certificate %sv%s [id: %s]" %
                         (isd_as, ver, cpld.req_id_str()))
Beispiel #8
0
 def _reply_cc(self, key, req_info):
     isd_as, ver = key
     meta = req_info[0]
     cert_chain = self.trust_store.get_cert(isd_as, ver)
     self.send_meta(CertChainReply.from_values(cert_chain), meta)
     logging.info("Cert chain for %sv%s sent to %s", isd_as, ver, meta)