Ejemplo n.º 1
0
    def Print(self, ShowRawXmlAsBytes=False):
        print("SecureSettingsApplyVariable")
        print("  HeaderSignature:  %s" % self.HeaderSignature)
        print("  HeaderVersion:    0x%X" % self.HeaderVersion)
        print("  SessionId:        0x%X" % self.SessionId)
        print("  Payload Size:     0x%X" % self.PayloadSize)
        if (self.HeaderVersion == self.VERSION_V1):
            print("  SN Target:        %d" % self.SNTarget)
        elif (self.HeaderVersion == self.VERSION_V2):
            print("  Manufacturer:     %s" % self.Manufacturer)
            print("  Product Name:     %s" % self.ProductName)
            print("  SerialNumber:     %s" % self.SerialNumber)
        else:
            raise Exception("Invalid header version")

        if (self._PayloadXml is not None):
            print("%s" % self._PayloadXml.toprettyxml())
        else:
            print("XML TREE DOESN'T EXIST")

        if (ShowRawXmlAsBytes and (self.Payload != None)):
            print("  Payload Bytes:    ")
            ndbl = list(bytearray(self.Payload.encode()))
            print(type(ndbl))
            PrintByteList(ndbl)

        if (self.Signature != None):
            self.Signature.Print()
    def Print(self):
        print ("CertProvisioningVariable")
        print ("  HeaderSignature:  %s" % self.HeaderSignature)
        print ("  HeaderVersion:    0x%X" % self.HeaderVersion)
        print ("  Identity:         0x%X (%s)" % (self.Identity, self.IDENTITY_MAP[self.Identity]))
        print ("  SessionId:        0x%X" % self.SessionId)
        if (self.HeaderVersion == self.VERSION_V1):
            print ("  SN Target:        %d" % self.SNTarget)
        elif (self.HeaderVersion == self.VERSION_V2):
            print ("  Version:          %s" % self.Version)
            print ("  Lsv:              %s" % self.Lsv)
            print ("  Manufacturer:     %s" % self.Manufacturer)
            print ("  Product Name:     %s" % self.ProductName)
            print ("  SerialNumber:     %s" % self.SerialNumber)
        else:
            raise Exception("Invalid header version")

        print ("  TrustedCertSize:  0x%X" % self.TrustedCertSize)
        print ("  TrustedCert:    ")
        if(self.TrustedCert != None):
            ndbl = self.TrustedCert.tolist()
            PrintByteList(ndbl)

        if(self.TrustedCertSize > 0) and (self.TestSignature != None):
            print ("  TestSignature:   ")
            self.TestSignature.Print()

        if(self.Signature != None):
            print ("  Signature:   ")
            self.Signature.Print()
Ejemplo n.º 3
0
 def Print(self):
     print("WinCertPKCS115")
     print("  Hdr_dwLength:         0x%X" % self.Hdr_dwLength)
     print("  Hdr_wRevision:        0x%X" % self.Hdr_wRevision)
     print("  Hdr_wCertificateType: 0x%X" % self.Hdr_wCertificateType)
     print("  Hash Guid:            %s" % str(self.HashAlgorithm))
     print("  CertData:             ")
     cdl = self.CertData.tolist()
     PrintByteList(cdl)
Ejemplo n.º 4
0
 def Print(self):
     print("WinCertUefiGuid")
     print("  Hdr_dwLength:         0x%X" % self.Hdr_dwLength)
     print("  Hdr_wRevision:        0x%X" % self.Hdr_wRevision)
     print("  Hdr_wCertificateType: 0x%X" % self.Hdr_wCertificateType)
     print("  CertType:             %s" % str(self.CertType))
     print("  CertData:             ")
     cdl = self.CertData.tolist()
     PrintByteList(cdl)
 def Print(self):
     print("EfiSignatureData - EfiSignatureDataEfiCertX509")
     print("  Signature Owner:      %s" % str(self.SignatureOwner))
     print("  Signature Data: ")
     if (self.SignatureData is None):
         print("    NONE")
     else:
         sdl = self.SignatureData.tolist()
         if (self.SignatureDataSize != len(sdl)):
             raise Exception(
                 "Invalid Signature Data Size vs Length of data")
         PrintByteList(sdl)
    def Print(self):
        print("EFiVariableAuthentication2")
        self.EfiTime.Print()
        self.AuthInfo.Print()
        print("-------------------- VARIABLE PAYLOAD --------------------")
        if (self.SigListPayload is not None):
            self.SigListPayload.Print()

        elif (self.Payload is not None):
            print("Raw Data: ")
            sdl = self.Payload.tolist()
            if (self.PayloadSize != len(sdl)):
                raise Exception("Invalid Payload Data Size vs Length of data")
            PrintByteList(sdl)
Ejemplo n.º 7
0
    def Print(self, ShowRawXmlAsBytes=False):
        print("SecureSettingResultVariable")
        print("  HeaderSignature:  %s" % self.HeaderSignature)
        print("  HeaderVersion:    0x%X" % self.HeaderVersion)
        print("  SessionId:        0x%X" % (self.SessionId))
        print(
            "  Status:           %s (0x%X)" %
            (UefiStatusCode().Convert64BitToString(self.Status), self.Status))
        print("  Payload Size:     0x%X" % self.PayloadSize)
        if (self._XmlTree is not None):
            print("%s" % self._XmlTree.toprettyxml())
        else:
            print("XML TREE DOESN'T EXIST")

        if (ShowRawXmlAsBytes and (self.Payload is not None)):
            print("  Payload Bytes:    ")
            ndbl = memoryview(self.Payload).tolist()
            PrintByteList(ndbl)
 def Print(self, compact: bool = False):
     if not compact:
         print("EfiSignatureData - EfiSignatureDataEfiCertX509")
         print("  Signature Owner:      %s" % str(self.SignatureOwner))
         print("  Signature Data: ")
         if(self.SignatureData is None):
             print("    NONE")
         else:
             sdl = self.SignatureData
             if(self.SignatureDataSize != len(sdl)):
                 raise Exception("Invalid Signature Data Size vs Length of data")
             PrintByteList(sdl)
     else:
         s = "ESD:EFI_CERT_X509,"
         s += "%s," % str(self.SignatureOwner)
         if(self.SignatureData is None):
             s += 'NONE'
         else:
             sdl = self.SignatureData
             for index in range(len(sdl)):
                 s += '%02X' % sdl[index]
         print(s)