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

ccreport.py: update document for latest naming #83

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The [APIs](common/python/cctrusted_base/api.py) are designed to be vendor agnost
| get_default_algorithms | Get the default Digest algorithms supported by trusted foundation. | | A `TcgAlgorithmRegistry` object telling the default algorithms |
| get_measurement_count | Get the count of measurement register. | | An integer telling the count of measurement registers |
| get_cc_measurement | Get measurement register according to given selected index and algorithms. | imr_select ([int, int]): The first is index of measurement register, the second is the algorithms ID | An integer telling the count of measurement registers |
| get_cc_report | Get the quote for given nonce and data. | nonce: a number used to protect private communications by preventing replay attacks<br> data: the data specified by user<br> extraArgs: the placeholder for extra arguments required in vTPM or other TEE cases | A `Quote` object |
| get_cc_report | Get the quote for given nonce and data. | nonce: a number used to protect private communications by preventing replay attacks<br> data: the data specified by user<br> extraArgs: the placeholder for extra arguments required in vTPM or other TEE cases | A `CcReport` (i.e. quote) object |
| get_cc_eventlog | Get eventlog for given index and count. | start: the index of the event log to start fetching<br> count: the number of event logs to fetch | A `TcgEventLog` object |

## 4. SDKs
Expand Down Expand Up @@ -136,15 +136,15 @@ __main__ INFO HASH: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

### 5.2 Sample of `get_cc_report` API

Below example code collect the Quote on the platform using `get_cc_report` API using `VMSDK` implemented by python.
Below example code collect the CcReport (i.e. quote) on the platform using `get_cc_report` API using `VMSDK` implemented by python.

```
from cctrusted import CCTrustedVmSdk

# Specify the `nonce`, `data` and `extraArgs` as None in the example
quote = CCTrustedVmSdk.inst().get_cc_report(None, None, None)
if quote is not None:
# Dump Quote object as raw data
# Dump CcReport (i.e. quote) object as raw data
quote.dump(is_raw=True)
```

Expand Down
10 changes: 5 additions & 5 deletions common/python/cctrusted_base/ccreport.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Quote data structures.
CcReport (i.e. quote) data structures.
"""

import logging
Expand All @@ -9,13 +9,13 @@
LOG = logging.getLogger(__name__)

class CcReportData(BinaryBlob):
"""Quote Data."""
"""CcReport Data."""

class CcReportSignature(BinaryBlob):
"""Quote Signature."""
"""CcReport Signature."""

class CcReport(BinaryBlob):
"""Quote base class."""
"""CcReport base class."""

def __init__(self, data: bytearray, cc_type):
"""Initialize instance with raw data.
Expand All @@ -41,7 +41,7 @@ def get_sig(self) -> CcReportSignature:

@abstractmethod
def dump(self, is_raw=True) -> None:
"""Dump Quote Data.
"""Dump CcReport Data.

Args:
is_raw:
Expand Down
Loading