Expose DecodePubHash

This commit is contained in:
Ettore Di Giacinto 2022-02-17 14:33:23 +01:00
parent fb83f16609
commit a7b15ad1f8
No known key found for this signature in database
GPG Key ID: 965A712536341999
2 changed files with 3 additions and 2 deletions

2
tpm.go
View File

@ -60,7 +60,7 @@ func GetPubHash(opts ...Option) (string, error) {
return "", fmt.Errorf("getting EK: %w", err)
}
hash, err := getPubHash(ek)
hash, err := DecodePubHash(ek)
if err != nil {
return "", fmt.Errorf("hashing EK: %w", err)
}

View File

@ -43,7 +43,8 @@ type ChallengeResponse struct {
Secret []byte
}
func getPubHash(ek *attest.EK) (string, error) {
// DecodePubHash returns the public key from an attestation EK
func DecodePubHash(ek *attest.EK) (string, error) {
data, err := pubBytes(ek)
if err != nil {
return "", err