diff --git a/vmsdk/python/cctrusted/__init__.py b/vmsdk/python/cctrusted/__init__.py index ec743861..04b029fe 100644 --- a/vmsdk/python/cctrusted/__init__.py +++ b/vmsdk/python/cctrusted/__init__.py @@ -4,3 +4,4 @@ # pylint: disable=syntax-error from .api import* +from .api_tdx import * diff --git a/vmsdk/python/cctrusted/api.py b/vmsdk/python/cctrusted/api.py index 102e4d87..d95755fd 100644 --- a/vmsdk/python/cctrusted/api.py +++ b/vmsdk/python/cctrusted/api.py @@ -6,8 +6,7 @@ # pylint: disable=unused-import from cctrusted_base.imr import TcgIMR from cctrusted_base.tcg import TcgAlgorithmRegistry -from cctrusted_base.tdx.report import TdReport -from .cvm import ConfidentialVM, TdxVM +from .cvm import ConfidentialVM LOG = logging.getLogger(__name__) @@ -43,13 +42,3 @@ def get_measurement(imr_select:[int, int]) -> TcgIMR: algo_id = cvm_inst.default_algo_id return cvm_inst.imrs[imr_index].digest(algo_id) - -def get_tdx_report() -> TdReport: - """ - Get TDX Report - """ - cvm_inst = ConfidentialVM.inst() - cvm_inst.dump() - - assert isinstance(cvm_inst, TdxVM) - return cvm_inst.tdreport diff --git a/vmsdk/python/cctrusted/api_tdx.py b/vmsdk/python/cctrusted/api_tdx.py new file mode 100644 index 00000000..869cbdad --- /dev/null +++ b/vmsdk/python/cctrusted/api_tdx.py @@ -0,0 +1,19 @@ +""" +API implementation for TDX specific +""" +import logging + +from cctrusted_base.tdx.report import TdReport +from .cvm import ConfidentialVM, TdxVM + +LOG = logging.getLogger(__name__) + +def get_tdx_report() -> TdReport: + """ + Get TDX Report + """ + cvm_inst = ConfidentialVM.inst() + cvm_inst.dump() + + assert isinstance(cvm_inst, TdxVM) + return cvm_inst.tdreport