Skip to content

Commit 436caaa

Browse files
authored
Fix an issue in pccs admintool's cache command (#410)
Signed-off-by: lingyuji <[email protected]>
1 parent 44e3fa0 commit 436caaa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: tools/PccsAdminTool/README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,5 @@ optional arguments:
9595
-u URL, --url URL The URL of the Intel PCS service; default: https://api.trustedservices.intel.com/sgx/certification/v4/
9696
-e EXPIRE_HOURS, --expire EXPIRE_HOURS
9797
How many hours the cache files will be valid for. Default is 2160 hours (90 days) and maximum is 8760.
98+
-t {standard,early}, --tcb_update_type {standard,early}
99+
Type of update to TCB info and enclave identities; default: standard

Diff for: tools/PccsAdminTool/pccsadmin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def main():
8383
parser_cache.add_argument("-o", "--output_dir", help="The destination directory for storing the generated cache files")
8484
parser_cache.add_argument("-s", "--sub_dir", help="Store output cache files in subdirectories named according to QE ID or Platform ID", action="store_true")
8585
parser_cache.add_argument("-e", "--expire", type=Utils.check_expire_hours, help="How many hours the cache files will be valid for. Default is 2160 hours (90 days).")
86+
parser_cache.add_argument("-t", "--tcb_update_type", help="Type of update to TCB info and enclave identities; default: standard", choices=['standard','early'])
8687
parser_cache.set_defaults(func=pcs_cache)
8788

8889
args = parser.parse_args()
@@ -530,6 +531,7 @@ class CacheCreator:
530531
def __init__(self, credentials, args):
531532
self.credentials = credentials
532533
self.args = args
534+
self.tcb_update_type = args.tcb_update_type or 'standard'
533535
self.sub_dir = bool(args.sub_dir)
534536

535537
@staticmethod
@@ -582,7 +584,7 @@ def create_platform_cache_file(self, platform, pcsclient, output_dir, expire_hou
582584
return False
583585

584586
fmspc = pckcerts[3]
585-
sgx_tcbinfo = pcsclient.get_tcb_info(fmspc, 'sgx', 'ascii')
587+
sgx_tcbinfo = pcsclient.get_tcb_info(fmspc, 'sgx', self.tcb_update_type, 'ascii')
586588
tcbcomponent = self._decompose_cpusvn_components(platform["cpu_svn"], json.loads(sgx_tcbinfo[0])["tcbInfo"]["tcbType"])
587589
self.write_to_cache_file(platform, output_dir, expire_hours, tcbcomponent, sgx_tcbinfo, pckcerts)
588590
return True

0 commit comments

Comments
 (0)