Merge pull request #248 from 9elements/skl_kbl_km

manifest/key.go: Also print the correct KM hash for SKL/KBL
This commit is contained in:
ArthurHeymans 2021-06-16 13:24:36 +02:00 committed by GitHub
commit 69a9c4b528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -202,6 +202,11 @@ func (k *Key) PrintKMPubKey(kmAlg Algorithm) error {
}
hash.Write(buf.Bytes())
fmt.Printf(" Key Manifest Pubkey Hash: 0x%x\n", hash.Sum(nil))
// On SKL and KBL the exponent is not included in the KM hash
buf.Truncate(len(k.Data[4:]))
hash.Reset()
hash.Write(buf.Bytes())
fmt.Printf(" Key Manifest Pubkey Hash (Skylake and Kabylake only): 0x%x\n", hash.Sum(nil))
} else {
fmt.Printf(" Key Manifest Pubkey Hash: Unsupported Algorithm\n")
}