Skip to content

Commit

Permalink
Revert "testutil: improve error messaging when resetting the simulator"
Browse files Browse the repository at this point in the history
This reverts commit 389b7df.
chrisccoulson committed Jan 11, 2025
1 parent 09f4541 commit f6e96c0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions testutil/tpm.go
Original file line number Diff line number Diff line change
@@ -1074,18 +1074,15 @@ func ClearTPMUsingPlatformHierarchyT(t *testing.T, tpm *tpm2.TPMContext) {

func resetTPMSimulator(tpm *tpm2.TPMContext, transport *mssim.Transport, startup bool) error {
if err := tpm.Shutdown(tpm2.StartupClear); err != nil {
return fmt.Errorf("shutdown failed: %w", err)
return err
}
if err := transport.Reset(); err != nil {
return fmt.Errorf("resetting the simulator failed: %w", err)
return fmt.Errorf("resetting the simulator failed: %v", err)
}
if !startup {
return nil
}
if err := tpm.Startup(tpm2.StartupClear); err != nil {
return fmt.Errorf("startup failed: %w", err)
}
return nil
return tpm.Startup(tpm2.StartupClear)
}

// ResetTPMSimulatorT issues a Shutdown(Clear) -> Reset -> Startup(Clear) cycle of the

0 comments on commit f6e96c0

Please sign in to comment.