Changeset 1142 for TI12-security


Ignore:
Timestamp:
08/06/06 13:32:29 (14 years ago)
Author:
pjkersha
Message:

NDG/AttAuthority.py: use new AttCert? class vars for mapped/original provenance flags

NDG/AttCert.py:

  • Fixed bug in setValidityTime - code to apply not before time offset was incorrectly indented so that it wasn't

applied.

  • Added class vars for mapped/original provenance flags
Location:
TI12-security/trunk/python/NDG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/NDG/AttAuthority.py

    r1125 r1142  
    387387 
    388388            # Mark new Attribute Certificate as an original 
    389             attCert['provenance'] = 'original' 
     389            attCert['provenance'] = AttCert.origProvenance 
    390390 
    391391        else:             
     
    465465             
    466466            # Mark new Attribute Certificate as mapped 
    467             attCert['provenance'] = 'mapped' 
     467            attCert['provenance'] = AttCert.mappedProvenance 
    468468 
    469469            # End set mapped certificate block 
  • TI12-security/trunk/python/NDG/AttCert.py

    r1131 r1142  
    5252    # Provenance of certificate may be original or mapped from another 
    5353    # certificate 
    54     __provenance = ('original', 'mapped') 
     54    mappedProvenance = 'mapped' 
     55    origProvenance = 'original' 
     56    __provenance = (origProvenance, mappedProvenance) 
    5557 
    5658 
     
    359361    def isOriginal(self): 
    360362        """Check for original provenance.""" 
    361         return self.__dat['provenance'] == 'original' 
     363        return self.__dat['provenance'] == self.__class__.origProvenance 
    362364 
    363365 
    364366    def isMapped(self): 
    365367        """Check for mapped provenance.""" 
    366         return self.__dat['provenance'] == 'mapped' 
     368        return self.__dat['provenance'] == self.__class__.mappedProvenance 
    367369 
    368370 
     
    604606            self.__dtNotBefore = datetime.utcnow() 
    605607             
    606             if notBeforeOffset is not None: 
    607                 self.__dtNotBefore += timedelta(seconds=notBeforeOffset) 
     608        if notBeforeOffset is not None: 
     609            self.__dtNotBefore += timedelta(seconds=notBeforeOffset) 
    608610             
    609611 
Note: See TracChangeset for help on using the changeset viewer.