Skip to content

Commit

Permalink
testutil: NewWrappedDevice -> WrapDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisccoulson committed Jan 12, 2024
1 parent f359ab6 commit 1c9acc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion testutil/tpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,11 @@ func newDevice(features TPMFeatureFlags) (tpm2.TPMDevice, error) {
}, nil
}

func NewWrappedDevice(device tpm2.TPMDevice, features TPMFeatureFlags) tpm2.TPMDevice {
// WrapDevice wraps the supplied device so that transports created by it are wrapped by [WrapTransport]
// and authorized to use the specified features. If the test requires features that are not permitted, as
// defined by the PermittedTPMFeatures variable, the wrapped device will return ErrSkipNoTPM instead of
// a transport.
func WrapDevice(device tpm2.TPMDevice, features TPMFeatureFlags) tpm2.TPMDevice {
if features&PermittedTPMFeatures != features {
device = nil
}
Expand Down

0 comments on commit 1c9acc3

Please sign in to comment.