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

Windows TPM Base Services (TBS) - Implement Tbsi_Get_OwnerAuth #276

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jmg292
Copy link

@jmg292 jmg292 commented Mar 21, 2022

Implementation and tests for TBS.h function Tbsi_Get_OwnerAuth.

Fixes #275

@jmg292 jmg292 requested a review from a team as a code owner March 21, 2022 08:42
Copy link
Member

@chrisfenner chrisfenner left a comment

Choose a reason for hiding this comment

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

Thanks for the change! Sorry for the slow response. I have a couple of questions about this

@@ -250,3 +264,26 @@ func (context Context) GetTCGLog(logBuffer []byte) (uint32, error) {
)
return logBufferLen, getError(result)
}

// GetOwnerAuth Retrieves the owner authorization of the TPM if the information is available in the local registry.
// If ownerAuthBuffer is nil, the actual size of the TPM ownerAuth is returned.
Copy link
Member

Choose a reason for hiding this comment

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

Why not allocate the slice from within this function and return ([]byte, error)?

t.Log("Skipping retrieval of Storage authorization; Delegation blob not available in the registry.")
t.SkipNow()
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Might make sense to try using the auth value to make sure it came through correctly (i.e., doesn't need base64 decoded or something)

defer ctx.Close()

authBufferLength, err := ctx.GetOwnerAuth(Storage20Authorization, nil)
if err == ErrOwnerauthNotFound || err == ErrInternalError {
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that this check will only skip the test if the TBS call failed due to lack of admin rights?

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.

Windows TPM Base Services (TBS) - Missing Functionality
2 participants