You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the latest published version (v0.3.2) of this library with a TPM 2.0.
With the following code (copied from the examples):
funcmain() {
tpm, err:=attest.OpenTPM(nil)
iferr!=nil {
log.Fatalf("Failed to open TPM: %v", err)
}
defertpm.Close()
log.Printf("+ Opened TPM!\n")
// Create a new AK.ak, err:=tpm.NewAK(nil)
iferr!=nil {
log.Fatalf("Failed to create AK: %v", err)
}
deferak.Close(tpm)
log.Printf("+ Created new AK\n")
// Read the EK.ek, err:=tpm.EKs()
iferr!=nil {
log.Fatalf("Failed to enumerate EKs: %v", err)
}
log.Printf("+ Got EKs len=%d ==> %+v\n", len(ek), ek)
// Read parameters necessary to generate a challenge.ap:=ak.AttestationParameters()
// Generate a credential activation challenge (usually done on the server).activation:= attest.ActivationParameters{
TPMVersion: tpm.Version(),
EK: ek[0].Public,
AK: ap,
}
secret, challenge, err:=activation.Generate()
iferr!=nil {
log.Fatalf("Failed to generate activation challenge: %v", err)
}
// Challenge the AK & EK properties to recieve the decrypted secret.decrypted, err:=ak.ActivateCredential(tpm, *challenge)
iferr!=nil {
log.Fatalf("Failed to activate credential: %v", err)
}
// Check that the AK completed the challenge (usually done on the server).ifsubtle.ConstantTimeCompare(secret, decrypted) ==0 {
log.Fatal("Activation response did not match secret")
}
}
It seems that, if I execute the program, it never finishes after calling tpm.EKs().
After a little debugging it came clear that the tpm2.NVReadEx(…) tries to determine the block size if the blockSize parameter is zero by reading the capability NVMaxBufferSize.
But it seems that my TPM does not have this capability:
I'm using the latest published version (
v0.3.2
) of this library with a TPM 2.0.With the following code (copied from the examples):
It seems that, if I execute the program, it never finishes after calling
tpm.EKs()
.After a little debugging it came clear that the
tpm2.NVReadEx(…)
tries to determine the block size if theblockSize
parameter is zero by reading the capabilityNVMaxBufferSize
.But it seems that my TPM does not have this capability:
Command Output
The text was updated successfully, but these errors were encountered: