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

Tbsi_Get_OwnerAuth can't get real OwnerAuth #64

Closed
AlanZsm opened this issue Apr 24, 2020 · 2 comments
Closed

Tbsi_Get_OwnerAuth can't get real OwnerAuth #64

AlanZsm opened this issue Apr 24, 2020 · 2 comments

Comments

@AlanZsm
Copy link

AlanZsm commented Apr 24, 2020

I'm trying to output the OwnerAuth in NV (Windows) sample as below:
byte[] ownerAuth;
if (GetOwnerAuthFromOS(out ownerAuth))
{
tpm.OwnerAuth = ownerAuth;
Console.WriteLine("OwnerAuth: {0}", BitConverter.ToString(ownerAuth));
}
I tried it on 2 of my computer, but it always return all zero value, while the actuall OwnerAuth is not null (read by get-tpm with power shell):
Running as Administrator. Deleting and re-creating NV entry.
OwnerAuth: 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

It is a bug?

@amarochk
Copy link
Contributor

Tbsi_Get_OwnerAuth() is a Win32 API outside of the TSS.Net control. TSS.Net can only accept what it receives from it. Otherwise it is the user's responsibility to supply correct auth values. Windows have been changing the way it manages the TPM auth values, and Windows 10 normally leaves TPM_RH_OWNER auth value an empty value. If your code gets BadAuth response when using TpmRh.Owner handle you could try to use the value returned by Get-Tpm (though it may not be the actual auth value if your Windows was configured by someone to use it).

@AlanZsm
Copy link
Author

AlanZsm commented Apr 24, 2020

Thanks for explanation!

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

No branches or pull requests

2 participants