Ejemplo n.º 1
0
 def extract_cert_chain(cls, header, data):
     offset = header.code_size + header.sig_size
     size = header.cert_chain_size
     if header.supports_qti_signing():
         offset += header.sig_size_qti + header.cert_chain_size_qti
     data, seg = extract_segment(data, offset, size)
     return data, seg
Ejemplo n.º 2
0
 def extract_encryption_params(cls, data):
     for magic in [
             EncryptionParamsInfoHdr_1_0.byte_sequence(),
             EncryptionParamsInfoHdr_2_0.byte_sequence(), SSD_MAGIC
     ]:
         magic_index = data.find(magic)
         if magic_index != -1:
             offset = magic_index
             size = len(data) - offset
             return extract_segment(data, offset, size)
     return data, ""
Ejemplo n.º 3
0
 def extract_cert_chain(cls, header, data):
     offset = header.code_size + header.sig_size
     size = header.cert_chain_size
     data, seg = extract_segment(data, offset, size)
     return data, seg
Ejemplo n.º 4
0
 def extract_cert_chain_qti(cls, header, data):
     offset = header.code_size + header.sig_size_qti
     size = header.cert_chain_size_qti
     return extract_segment(data, offset, size)
Ejemplo n.º 5
0
 def extract_sign_qti(cls, header, data):
     offset = header.code_size
     size = header.sig_size_qti
     return extract_segment(data, offset, size)