diff --git a/src/gcf/geni/util/speaksfor_util.py b/src/gcf/geni/util/speaksfor_util.py index 93c498b7..4a346609 100644 --- a/src/gcf/geni/util/speaksfor_util.py +++ b/src/gcf/geni/util/speaksfor_util.py @@ -156,9 +156,9 @@ def verify_speaks_for(cred, tool_gid, speaking_for_urn, \ if cred.get_cred_type() != ABACCredential.ABAC_CREDENTIAL_TYPE: return False, None, "Credential not of type ABAC but %s" % cred.get_cred_type - if cred.signature is None or cred.signature.gid is None: + if cred.get_signature() is None or cred.signature.gid is None: return False, None, "Credential malformed: missing signature or signer cert. Cred: %s" % cred.get_summary_tostring() - user_gid = cred.signature.gid + user_gid = cred.get_signature().get_issuer_gid() user_urn = user_gid.get_urn() # URN of signer from cert must match URN of 'speaking-for' argument diff --git a/src/gcf/sfa/trust/credential.py b/src/gcf/sfa/trust/credential.py index 31ebf366..046170e4 100644 --- a/src/gcf/sfa/trust/credential.py +++ b/src/gcf/sfa/trust/credential.py @@ -189,7 +189,7 @@ def decode(self): logger.log_exc ("Failed to parse credential, %s"%self.xml) raise sig = doc.getElementsByTagName("Signature")[0] - ref_id = sig.getAttribute("xml:id").strip().strip("Sig_") + ref_id = sig.getAttribute("xml:id").strip().replace("Sig_","",1) # The xml:id tag is optional, and could be in a # Reference xml:id or Reference UID sub element instead if not ref_id or ref_id == '':