def parse_pivtool_data(raw_data): rest, _ = der_read(raw_data, TAG_PIVMAN_DATA) data = {} while rest: t, v, rest = der_read(rest) data[t] = v return data
def read_cert(self, slot): try: data = self.fetch_object(CERT_SLOTS[slot]) except PivError: return None cert, rest = der_read(data, 0x70) zipped, rest = der_read(rest, 0x71) if zipped != b'\0': pass # TODO: cert is compressed, uncompress. return cert
def read_cert(self, slot): try: data = self.fetch_object(CERT_SLOTS[slot]) except PivError: return None cert, rest = der_read(data, 0x70) zipped, rest = der_read(rest, 0x71) if zipped != chr(0): pass # TODO: cert is compressed, uncompress. return cert