Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmsdk: fetch real time data in the API #63

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion vmsdk/python/cctrusted_vm/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_measurement_count(self) -> int:
for DRTM).

Beyond the real mesurement register, some SDK may extend virtual measurement
reigster for addtional trust chain like container, namespace, cluster in
reigster for additional trust chain like container, namespace, cluster in
cloud native paradiagm.

Returns:
Expand Down Expand Up @@ -87,6 +87,9 @@ def get_measurement(self, imr_select:[int, int]) -> TcgIMR:
if algo_id is None or algo_id is TcgAlgorithmRegistry.TPM_ALG_ERROR:
algo_id = self._cvm.default_algo_id

# Re-do the processing to fetch the latest measurements
self._cvm.process_cc_report()

return self._cvm.imrs[imr_index]

def get_quote(
Expand Down Expand Up @@ -124,8 +127,12 @@ def get_eventlog(self, start:int = None, count:int = None) -> EventLogs:
Returns:
``Eventlogs`` object containing all event logs following TCG PCClient Spec.
"""
# Re-do the processing to fetch the latest event logs
self._cvm.process_eventlog()

event_logs = EventLogs(self._cvm.boot_time_event_log, self._cvm.runtime_event_log,
TcgEventLog.TCG_PCCLIENT_FORMAT)

event_logs.select(start, count)

return event_logs
Loading