## @file\r
# generate capsule\r
#\r
-# Copyright (c) 2007-2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
self.VendorCodeFile = []\r
self.Certificate_Guid = None\r
self.MonotonicCount = None\r
+ self.Existed = False\r
+ self.Buffer = None\r
\r
def GenCapsuleSubItem(self, AuthData=[]):\r
if not self.Version:\r
- self.Version = 0x00000002\r
+ self.Version = '0x00000002'\r
+ if not self.ImageIndex:\r
+ self.ImageIndex = '0x1'\r
+ if not self.HardwareInstance:\r
+ self.HardwareInstance = '0x0'\r
ImageFileSize = os.path.getsize(self.ImageFile)\r
if AuthData:\r
# the ImageFileSize need include the full authenticated info size. From first bytes of MonotonicCount to last bytes of certificate.\r
VendorFile = open(self.VendorCodeFile, 'rb')\r
Buffer += VendorFile.read()\r
VendorFile.close()\r
+ self.Existed = True\r
return Buffer\r