-
Notifications
You must be signed in to change notification settings - Fork 161
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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() | ||
} | ||
} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
Implementation and tests for
TBS.h
function Tbsi_Get_OwnerAuth.Fixes #275