Changeset df35876 for fedd/federation


Ignore:
Timestamp:
Jul 8, 2012 10:54:05 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, master
Children:
4708875
Parents:
25bf6cc
Message:

Somehow recoding the pems got missed here...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/proof.py

    r25bf6cc rdf35876  
    66import sys
    77import os, os.path
     8import re
    89
    910from string import join
     
    162163
    163164        return pp.proof
     165    @staticmethod
     166    def pem_to_der(c):
     167        pat = '-----BEGIN CERTIFICATE-----(.*)-----END CERTIFICATE'
     168        m = re.match(pat, c, re.DOTALL)
     169        if m: return b64decode(m.group(1))
     170        else: return c
     171
    164172
    165173    @staticmethod
     
    173181                self = proof(d['prover'], d['principal'], d['attribute'], None)
    174182                for c in d.get('credential', []):
    175                     if ac.load_id_chunk(c) != ABAC.ABAC_CERT_SUCCESS:
     183                    c = self.pem_to_der(c)
     184                    if ac.load_id_chunk(c)!= ABAC.ABAC_CERT_SUCCESS:
    176185                        ac.load_attribute_chunk(c)
    177186                self.creds = ac.credentials()
Note: See TracChangeset for help on using the changeset viewer.