Skip to content

Instantly share code, notes, and snippets.

View chrisccoulson's full-sized avatar

Chris Coulson chrisccoulson

View GitHub Profile
package main
import (
"fmt"
"os"
"github.com/canonical/go-tpm2"
"github.com/canonical/go-tpm2/linux"
)
@chrisccoulson
chrisccoulson / test_tpmauth.go
Last active August 3, 2021 23:31
test_tpmauth.go
// This tests behaviour of authorization value handling. Some things to note
// from the reference TPM implementation:
// - Authorization values for objects are stored padded with trailing zeroes to
// the size of the object's name algorithm.
// - Authorization values for hierarchies and NV indices are stored with trailing
// zeroes removed.
// - EntityGetAuthValue removes trailing zeroes from an entity's authorization
// value, prior to its use in the front end code when comparing comparing it
// against a password session or using it to compute a HMAC key for a HMAC
// session, or in the TPM2_StartAuthSession when computing the session key.

Keybase proof

I hereby claim:

  • I am chrisccoulson on github.
  • I am chrisccoulson (https://keybase.io/chrisccoulson) on keybase.
  • I have a public key whose fingerprint is 44DF FFE4 C1A0 08E8 3229 E205 611F BDEC D594 6E0F

To claim this, I am signing this object: