violate any copyrights that exist in this work. ''' import ConfigParser import os from M2Crypto import X509 import keylime.secure_mount as secure_mount import keylime.common as common import keylime.tpm_exec as tpm_exec # read the config file config = ConfigParser.RawConfigParser() config.read(common.CONFIG_FILE) logger = common.init_logging('delete-sa') def execute(revocation): serial = revocation.get("metadata", {}).get("cert_serial", None) if revocation.get('type', None) != 'revocation' or serial is None: logger.error("Unsupported revocation message: %s" % revocation) # load up the ca cert secdir = secure_mount.mount() ca = X509.load_cert('%s/unzipped/cacert.crt' % secdir) # need to find any sa's that were established with that cert serial output = tpm_exec.run("racoonctl show-sa ipsec", lock=False, raiseOnError=True)[0]
''' import time import os import ConfigParser import keylime.tornado_requests as tornado_requests import keylime.ca_util as ca_util import keylime.secure_mount as secure_mount import keylime.common as common # read the config file config = ConfigParser.RawConfigParser() config.read(common.CONFIG_FILE) logger = common.init_logging('update_crl') def execute(json_revocation): if json_revocation['type'] != 'revocation': return secdir = secure_mount.mount() cert_path = config.get('cloud_node', 'revocation_cert') if cert_path == "default": cert_path = '%s/unzipped/RevocationNotifier-cert.crt' % (secdir) else: # if it is a relative, convert to absolute in work_dir if cert_path[0] != '/': cert_path = os.path.abspath('%s/%s' % (common.WORK_DIR, cert_path))
This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for Research and Engineering. Copyright 2017 Massachusetts Institute of Technology. The software/firmware is provided to you on an As-Is basis Delivered to the US Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate any copyrights that exist in this work. ''' import keylime.common as common import ConfigParser # read the config file config = ConfigParser.RawConfigParser() config.read(common.CONFIG_FILE) logger = common.init_logging('print_metadata') def execute(json_revocation): print json_revocation.get("metadata", {})