Try reading the EKCert from PCP_EKNVCERT (#46)

This commit is contained in:
Tom D 2019-06-25 15:19:12 -07:00 committed by GitHub
parent 113729bb8b
commit 372fcf25d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,11 +395,11 @@ func (h *winPCP) EKCerts() ([]*x509.Certificate, error) {
// Reading the certificate from the system store has failed.
// Lets try reading the raw bytes directly from NVRAM instead.
if len(c) == 0 {
buf, err := getNCryptBufferProperty(h.hProv, "PCP_EKNVCERT")
certs, err := getPCPCerts(h.hProv, "PCP_EKNVCERT")
if err != nil {
return nil, fmt.Errorf("Failed to read PCP_EKNVCERT: %v", err)
}
c = append(c, buf)
c = append(c, certs...)
}
var out []*x509.Certificate