Ignore slightly malformed EKs so attestation can continue. (#24)

This commit is contained in:
Tom D 2019-05-02 13:43:50 -07:00 committed by GitHub
parent b6bb3dba4c
commit 8e4a5ce762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ func (h *winPCP) EKCerts() ([]*x509.Certificate, error) {
var out []*x509.Certificate
for _, der := range c {
cert, err := x509.ParseCertificate(der)
if err != nil {
if err != nil && x509.IsFatal(err) {
return nil, err
}
out = append(out, cert)

View File

@ -181,7 +181,7 @@ func (t *TPM) readEKCert12() ([]*x509.Certificate, error) {
return nil, err
}
cert, err := x509.ParseCertificate(ekcert)
if err != nil {
if err != nil && x509.IsFatal(err) {
return nil, err
}
return []*x509.Certificate{cert}, nil