Exemplo n.º 1
0
 def _rev_entries_handler(self, raw_entries):
     for raw in raw_entries:
         srev_info = SignedRevInfo.from_raw(raw)
         rev_info = srev_info.rev_info()
         self.check_revocation(
             srev_info, lambda x: self._remove_revoked_segments(rev_info)
             if not x else False)
Exemplo n.º 2
0
 def process_rev_objects(self, rev_infos):
     """
     Processes revocation infos stored in Zookeeper.
     """
     with self._rev_seg_lock:
         for raw in rev_infos:
             try:
                 srev_info = SignedRevInfo.from_raw(raw)
             except SCIONParseError as e:
                 logging.error("Error parsing revocation info from ZK: %s",
                               e)
                 continue
             self.check_revocation(
                 srev_info,
                 lambda x: lambda: self.local_rev_cache.add(srev_info)
                 if not x else False)
Exemplo n.º 3
0
 def _handle_scmp(self, spkt):
     scmp_hdr = spkt.l4_hdr
     spkt.parse_payload()
     if (scmp_hdr.class_ == SCMPClass.PATH
             and scmp_hdr.type == SCMPPathClass.REVOKED_IF):
         scmp_pld = spkt.get_payload()
         srev_info = SignedRevInfo.from_raw(scmp_pld.info.srev_info)
         rev_info = srev_info.rev_info()
         logging.info("Received revocation: %s (from %s)",
                      rev_info.short_desc(), spkt.addrs.src)
         lib_sciond.send_rev_notification(srev_info,
                                          connector=self._connector)
         return ResponseRV.RETRY
     else:
         logging.error("Received SCMP error:\n%s", spkt)
         return ResponseRV.FAILURE
Exemplo n.º 4
0
 def handle_scmp_revocation(self, pld, meta):
     srev_info = SignedRevInfo.from_raw(pld.info.srev_info)
     self.handle_revocation(CtrlPayload(PathMgmt(srev_info)), meta)