这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion testing/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ func Match(got error, want string) bool {
if got == nil {
return want == ""
}
return strings.Contains(got.Error(), want)
return want != "" && strings.Contains(got.Error(), want)
}
1 change: 1 addition & 0 deletions verify/trust/trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func (r *ProductCerts) X509Options(now time.Time) *x509.VerifyOptions {
roots.AddCert(r.Ark)
intermediates := x509.NewCertPool()
intermediates.AddCert(r.Ask)
fmt.Printf("but now is %s\n", now.Format(time.RFC3339))
return &x509.VerifyOptions{Roots: roots, Intermediates: intermediates, CurrentTime: now}
}

Expand Down
4 changes: 4 additions & 0 deletions verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ func validateVcekCertificateProductSpecifics(r *trust.AMDRootCerts, cert *x509.C
if err := ValidateVcekCertIssuer(r, cert.Issuer); err != nil {
return err
}
fmt.Printf("now is %s\n", opts.Now.Format(time.RFC3339))
if _, err := cert.Verify(*r.X509Options(opts.Now)); err != nil {
return fmt.Errorf("error verifying VCEK certificate: %v (%v)", err, r.ProductCerts.Ask.IsCA)
}
Expand Down Expand Up @@ -528,6 +529,9 @@ func SnpAttestation(attestation *spb.Attestation, options *Options) error {
if options == nil {
return fmt.Errorf("options cannot be nil")
}
if attestation == nil {
return fmt.Errorf("attestation cannot be nil")
}
// Make sure we have the whole certificate chain if we're allowed.
if !options.DisableCertFetching {
if err := fillInAttestation(attestation, options); err != nil {
Expand Down
4 changes: 3 additions & 1 deletion verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ func TestKdsMetadataLogic(t *testing.T) {
Ask: newSigner.Ask,
},
}},
}}
},
Now: time.Date(1, time.January, 5, 0, 0, 0, 0, time.UTC),
}
if tc.wantErr != "" {
options = &Options{}
}
Expand Down