Exemple #1
0
 def getChild(self, which):
     p = TlsStructure(self.value)
     for x in range(which + 1):
         if p.index == len(p.bytes):
             return None
         markIndex = p.index
         p.getInt(1)  #skip Type
         length = self._getASN1Length(p)
         p.getBytes(length)
     return ASN1Parser(p.bytes[markIndex:p.index],
                       self.offset + self.headerLength + markIndex)
Exemple #2
0
 def getChild(self, which):
     p = TlsStructure(self.value)
     for x in range(which+1):
         if p.index == len(p.bytes):
             return None
         markIndex = p.index
         p.getInt(1) #skip Type
         length = self._getASN1Length(p)
         p.getBytes(length)
     return ASN1Parser(p.bytes[markIndex : p.index],
                       self.offset + self.headerLength + markIndex)
Exemple #3
0
    def __init__(self, bytes, offset=0):
        p = TlsStructure(bytes)
        self.type = p.getInt(1)  #skip Type

        #Get Length
        self.length = self._getASN1Length(p)

        # Header length is however many bytes read so far
        self.headerLength = p.index

        #Get Value
        self.value = p.getBytes(self.length)

        # This value tracks the offset of this TLV field
        # in some enclosing structure (ie an X.509 cert)
        self.offset = offset
Exemple #4
0
    def __init__(self, bytes, offset = 0):
        p = TlsStructure(bytes)
        self.type = p.getInt(1) #skip Type

        #Get Length
        self.length = self._getASN1Length(p)
        
        # Header length is however many bytes read so far
        self.headerLength = p.index        

        #Get Value
        self.value = p.getBytes(self.length)
        
        # This value tracks the offset of this TLV field
        # in some enclosing structure (ie an X.509 cert) 
        self.offset = offset