From 9c4523e9a0ea8ca5b578b3fe0182508705962f9b Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 15 Aug 2011 18:47:47 -0400 Subject: [PATCH] CA certs are only given to objects of type authority --- sfa/trust/hierarchy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sfa/trust/hierarchy.py b/sfa/trust/hierarchy.py index f28329ce..89bebcc6 100644 --- a/sfa/trust/hierarchy.py +++ b/sfa/trust/hierarchy.py @@ -231,13 +231,19 @@ class Hierarchy: def create_gid(self, xrn, uuid, pkey): hrn, type = urn_to_hrn(xrn) + parent_hrn = get_authority(hrn) # Using hrn_to_urn() here to make sure the urn is in the right format # If xrn was a hrn instead of a urn, then the gid's urn will be # of type None urn = hrn_to_urn(hrn, type) gid = GID(subject=hrn, uuid=uuid, hrn=hrn, urn=urn) - parent_hrn = get_authority(hrn) + # is this a CA cert + if hrn == self.config.SFA_INTERFACE_HRN or \ + or not parent_hrn or 'authority' in type: + gid.set_intermediate_ca(True) + + # set issuer if not parent_hrn or hrn == self.config.SFA_INTERFACE_HRN: # if there is no parent hrn, then it must be self-signed. this # is where we terminate the recursion @@ -247,7 +253,6 @@ class Hierarchy: parent_auth_info = self.get_auth_info(parent_hrn) gid.set_issuer(parent_auth_info.get_pkey_object(), parent_auth_info.hrn) gid.set_parent(parent_auth_info.get_gid_object()) - gid.set_intermediate_ca(True) gid.set_pubkey(pkey) gid.encode() -- 2.43.0