Skip to content

Commit

Permalink
Revert to the fix for issue GENI-NSF#890 integrated in main geni-tool…
Browse files Browse the repository at this point in the history
… repository
  • Loading branch information
dmargery committed Feb 24, 2016
2 parents 7b11867 + 0799f71 commit 39fc986
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

gcf 2.11:
* Remove bogus check for rspec tag (#885)
* Properly remove prefix from signature refid in SFA credentials. (#890)

gcf 2.10:
* Changed references to trac.gpolab.bbn.com to point to Github.
Expand Down
22 changes: 22 additions & 0 deletions agg_nick_cache.base
Original file line number Diff line number Diff line change
Expand Up @@ -721,3 +721,25 @@ ukl-og3=urn:publicid:IDN+glab077.e4.ukl.german-lab.de:gcf+authority+am,https://g
kaiserslautern-og=urn:publicid:IDN+glab077.e4.ukl.german-lab.de:gcf+authority+am,https://glab077.e4.ukl.german-lab.de:5002
kaiserslautern-og2=urn:publicid:IDN+glab077.e4.ukl.german-lab.de:gcf+authority+am,https://glab077.e4.ukl.german-lab.de:5002
kaiserslautern-og3=urn:publicid:IDN+glab077.e4.ukl.german-lab.de:gcf+authority+am,https://glab077.e4.ukl.german-lab.de:5001

# =====
# University of Michigan InstaGENI
# =====
umich-ig=urn:publicid:IDN+instageni.research.umich.edu+authority+cm,https://instageni.research.umich.edu:12369/protogeni/xmlrpc/am/2.0
umich-ig1=urn:publicid:IDN+instageni.research.umich.edu+authority+cm,https://instageni.research.umich.edu:12369/protogeni/xmlrpc/am/1.0
umich-ig2=urn:publicid:IDN+instageni.research.umich.edu+authority+cm,https://instageni.research.umich.edu:12369/protogeni/xmlrpc/am/2.0
umich-ig3=urn:publicid:IDN+instageni.research.umich.edu+authority+cm,https://instageni.research.umich.edu:12369/protogeni/xmlrpc/am/3.0
umich-ig-of=urn:publicid:IDN+openflow:foam:foam.instageni.research.umich.edu+authority+am,https://foam.instageni.research.umich.edu:3626/foam/gapi/2
umich-ig-of1=urn:publicid:IDN+openflow:foam:foam.instageni.research.umich.edu+authority+am,https://foam.instageni.research.umich.edu:3626/foam/gapi/1
umich-ig-of2=urn:publicid:IDN+openflow:foam:foam.instageni.research.umich.edu+authority+am,https://foam.instageni.research.umich.edu:3626/foam/gapi/2

# =====
# University of Kentucky MCV InstaGENI
# =====
ukymcv-ig=urn:publicid:IDN+mcv.sdn.uky.edu+authority+cm,https://mcv.sdn.uky.edu:12369/protogeni/xmlrpc/am/2.0
ukymcv-ig1=urn:publicid:IDN+mcv.sdn.uky.edu+authority+cm,https://mcv.sdn.uky.edu:12369/protogeni/xmlrpc/am/1.0
ukymcv-ig2=urn:publicid:IDN+mcv.sdn.uky.edu+authority+cm,https://mcv.sdn.uky.edu:12369/protogeni/xmlrpc/am/2.0
ukymcv-ig3=urn:publicid:IDN+mcv.sdn.uky.edu+authority+cm,https://mcv.sdn.uky.edu:12369/protogeni/xmlrpc/am/3.0
ukymcv-ig-of=urn:publicid:IDN+openflow:foam:foam.mcv.sdn.uky.edu+authority+am,https://foam.mcv.sdn.uky.edu:3626/foam/gapi/2
ukymcv-ig-of1=urn:publicid:IDN+openflow:foam:foam.mcv.sdn.uky.edu+authority+am,https://foam.mcv.sdn.uky.edu:3626/foam/gapi/1
ukymcv-ig-of2=urn:publicid:IDN+openflow:foam:foam.mcv.sdn.uky.edu+authority+am,https://foam.mcv.sdn.uky.edu:3626/foam/gapi/2
12 changes: 9 additions & 3 deletions src/gcf/sfa/trust/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,26 @@ def set_issuer_gid(self, gid):
self.gid = gid

def decode(self):
# Helper function to pull characters off the front of a string if present
def remove_prefix(text, prefix):
if text and prefix and text.startswith(prefix):
return text[len(prefix):]
return text

try:
doc = parseString(self.xml)
except ExpatError,e:
logger.log_exc ("Failed to parse credential, %s"%self.xml)
raise
sig = doc.getElementsByTagName("Signature")[0]
ref_id = sig.getAttribute("xml:id").strip().replace("Sig_","",1)
ref_id = remove_prefix(sig.getAttribute("xml:id").strip(), "Sig_")
# 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 == '':
reference = sig.getElementsByTagName('Reference')[0]
ref_id = reference.getAttribute('xml:id').strip().strip('Sig_')
ref_id = remove_prefix(reference.getAttribute('xml:id').strip(), 'Sig_')
if not ref_id or ref_id == '':
ref_id = reference.getAttribute('URI').strip().strip('#')
ref_id = remove_prefix(reference.getAttribute('URI').strip(), '#')
self.set_refid(ref_id)
keyinfos = sig.getElementsByTagName("X509Data")
gids = None
Expand Down

0 comments on commit 39fc986

Please sign in to comment.