X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Ftrust%2Fgid.py;h=7450b4d33de47a164a406ad20c3d4f5be38b8f9c;hb=04acd3228e5911d36d0cd58dc35b9319fc558e17;hp=5d7ce57880f36c7afb371e622e1d1a8d07d903df;hpb=0a9902d2a55a0a9ac03601345c4284293669012b;p=sfa.git diff --git a/sfa/trust/gid.py b/sfa/trust/gid.py index 5d7ce578..7450b4d3 100644 --- a/sfa/trust/gid.py +++ b/sfa/trust/gid.py @@ -25,16 +25,16 @@ # descendant of the certificate class. ## -from __future__ import print_function + import uuid +import xmlrpc.client from sfa.trust.certificate import Certificate from sfa.util.faults import GidInvalidParentHrn, GidParentHrn from sfa.util.xrn import hrn_to_urn, urn_to_hrn, hrn_authfor_hrn from sfa.util.sfalogging import logger -from sfa.util.py23 import xmlrpc_client ## # Create a new uuid. Returns the UUID as a string. @@ -156,15 +156,15 @@ class GID(Certificate): else: urn = hrn_to_urn(self.hrn, None) - str = "URI:" + urn + string = "URI:" + urn if self.uuid: - str += ", " + "URI:" + uuid.UUID(int=self.uuid).urn + string += ", " + "URI:" + uuid.UUID(int=self.uuid).urn if self.email: - str += ", " + "email:" + self.email + string += ", " + "email:" + self.email - self.set_data(str, 'subjectAltName') + self.set_data(string, 'subjectAltName') ## # Decode the subject-alt-name field of the X509 certificate into the @@ -176,7 +176,7 @@ class GID(Certificate): dict = {} if data: if data.lower().startswith('uri:http://'): - dict = xmlrpc_client.loads(data[11:])[0][0] + dict = xmlrpc.client.loads(data[11:])[0][0] else: spl = data.split(', ') for val in spl: @@ -232,7 +232,9 @@ class GID(Certificate): # planetlab.us.arizona cannot sign a GID for planetlab.us.princeton.foo. def verify_chain(self, trusted_certs=None): - logger.debug("GID.verify_chain with {} trusted certs".format(len(trusted_certs))) + logger.debug(10*'=' + " GID.verify_chain with {} trusted certs" + .format(len(trusted_certs))) + logger.debug("on {}".format(self.pretty_name())) # do the normal certificate verification stuff trusted_root = Certificate.verify_chain(self, trusted_certs)