Skip to content

feat(esapi): implement a missing TPM command in command_audit#655

Open
hyperfinitism wants to merge 1 commit into
parallaxsecond:mainfrom
hyperfinitism:feature/command-audit
Open

feat(esapi): implement a missing TPM command in command_audit#655
hyperfinitism wants to merge 1 commit into
parallaxsecond:mainfrom
hyperfinitism:feature/command-audit

Conversation

@hyperfinitism

Copy link
Copy Markdown
Contributor

This pull request implements the following Esys wrapper function with its integration test:

  • set_command_code_audit_status (ESAPI Spec 11.3.50)

Migrated from #625.

Added the following wrapper function with its integration test:

- set_command_code_audit_status (ESAPI Spec 11.3.50)

Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing ESAPI wrapper for Esys_SetCommandCodeAuditStatus to the command_audit TPM command module, along with an integration test to validate the wrapper against GetCapability(AuditCommands).

Changes:

  • Implement Context::set_command_code_audit_status (ESAPI Spec §11.3.50) with proper return-code handling and logging.
  • Add an integration test that toggles auditing for CommandCode::GetRandom and verifies the audit command list updates accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tss-esapi/src/context/tpm_commands/command_audit.rs Adds the ESAPI wrapper method for setting command code audit status.
tss-esapi/tests/integration_tests/context_tests/tpm_commands/command_audit_tests.rs Adds an integration test validating audit status changes via capability queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
mod test_set_command_code_audit_status {
use crate::common::create_ctx_with_session;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it to you if you want to apply these changes re. the testing.


#[test]
fn test_set_command_code_audit_status() {
let mut context = create_ctx_with_session();

@ionut-arm ionut-arm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
mod test_set_command_code_audit_status {
use crate::common::create_ctx_with_session;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it to you if you want to apply these changes re. the testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants