def PrintSEMResults(filepath):
    if (filepath and os.path.isfile(filepath)):
        s = open(filepath, "rb")
        SEM = SecureSettingsResultVariable(s)
        s.close()

        #now print it out.
        SEM.Print(True)
Beispiel #2
0
 def get_payload_from_settings_results(self, resultfile, payloadfile):
     f = open(resultfile, 'rb')
     rslt = SecureSettingsResultVariable(f)
     rslt.Print()
     f.close()
     if rslt.Payload != None:
         f = open(payloadfile, "w")
         f.write(rslt.Payload)
         f.close
     return 0
Beispiel #3
0
 def get_status_and_sessionid_from_settings_results(self, resultfile):
     f = open(resultfile, 'rb')
     rslt = SecureSettingsResultVariable(f)
     rslt.Print()
     f.close()
     RsltRc = rslt.Status
     if RsltRc == 0:
         try:
             tree = ET.fromstring(rslt.Payload)
             for elem in tree.findall('./Settings/SettingResult'):
                 rc = int(elem.find('Result').text, 0)
                 if rc != 0:
                     RsltRc = rc
                 print('Setting %s - Code %s' %
                       (elem.find('Id').text, elem.find('Result').text))
         except:
             traceback.print_exc()
     return RsltRc, rslt.SessionId
Beispiel #4
0
 def get_status_and_sessionid_from_settings_results(self, resultfile, checktype):
     f = open(resultfile, 'rb')
     rslt = SecureSettingsResultVariable(f)
     rslt.Print()
     f.close()
     if (checktype != "FULL") and (checktype != "BASIC"):
         print('checktype invalid')
         return  0x8000000000000007, 0  # EFI_DEVICE_ERROR
     RsltRc = rslt.Status
     if RsltRc == 0 and checktype == "FULL":
         try:
             tree = ET.fromstring(rslt.Payload)
             for elem in tree.findall('./Settings/SettingResult'):
                 rc = int (elem.find('Result').text,0)
                 if rc != 0:
                     RsltRc = rc
                 print('Setting %s - Code %s' % (elem.find('Id').text,elem.find('Result').text))
         except:
             traceback.print_exc()
     return RsltRc, rslt.SessionId