Skip to content

Commit

Permalink
common: expand CcReport definition for configfs-tsm support (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruoyu-y authored Apr 12, 2024
1 parent fbd4c5e commit 3455e7e
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions common/python/cctrusted_base/ccreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,49 @@ class CcReportSignature(BinaryBlob):
class CcReport(BinaryBlob):
"""CcReport base class."""

def __init__(self, data: bytearray, cc_type):
def __init__(
self,
data: bytearray,
cc_type,
aux_blob: bytearray=None,
generation:int=None,
provider:str=None
):
"""Initialize instance with raw data.
Args:
data: A bytearray storing the raw data.
data: A bytearray storing the raw data(in configfs-tsm, the data contained in outblob).
cc_type: An int specifying the TEE type
aux_blob: A bytearray storing aux data when leveraging configfs-tsm.
generation: An int specifying generation when leveraging configfs-tsm.
provider: A string specifying provider when leveraging configfs-tsm.
"""
super().__init__(data)
self._cc_type = cc_type
self._cc_aux_blob = aux_blob
self._cc_report_generation = generation
self._cc_provider = provider

@property
def cc_type(self):
"""Get the CC (Confidential Computing) type."""
return self._cc_type

@property
def cc_aux_blob(self):
"""Get the aux blob of CC report."""
return self._cc_aux_blob

@property
def cc_report_generation(self):
"""Get the report generation."""
return self._cc_report_generation

@property
def cc_provider(self):
"""Get cc provider."""
return self._cc_provider

@abstractmethod
def get_quoted_data(self) -> CcReportData:
"""Get quoted data."""
Expand Down

0 comments on commit 3455e7e

Please sign in to comment.