Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude additional lints in GetCertificateChain and support multiple error codes #349

Merged
merged 1 commit into from
Aug 29, 2024
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
5 changes: 5 additions & 0 deletions verification/testing/getCertificateChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func checkCertificateChain(t *testing.T, certData []byte) []*x509.Certificate {
// We will need to truncate the serial numbers for those certs and
// then enable this lint.
"e_subject_dn_serial_number_max_length",
// Firmware certificates don't get revocated, so there is no need
// for a CRSL to be specified in the CA certificate.
"w_distribution_point_missing_ldap_or_uri",
// Authority Information Access for CA can also be an HTTPS URI.
"w_ext_aia_access_location_missing",
},
})
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions verification/testing/initializeContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ func testInitContext(d client.TestDPEInstance, c client.DPEClient, t *testing.T,
// Try to initialize another default context.
_, err := c.InitializeContext(client.InitIsDefault)
if err == nil {
t.Fatal("The instance should return an error when trying to initialize another default context.")
} else if !errors.Is(err, client.StatusArgumentNotSupported) {
t.Fatalf("Incorrect error type. Should return %q, but returned %q", client.StatusArgumentNotSupported, err)
t.Error("The instance should return an error when trying to initialize another default context.")
} else if !(errors.Is(err, client.StatusArgumentNotSupported) || errors.Is(err, client.StatusInvalidArgument)) {
t.Errorf("Incorrect error type. Should return %q or %q, but returned %q", client.StatusArgumentNotSupported, client.StatusInvalidArgument, err)
}

// Try to initialize a context that is neither default or simulation.
_, err = c.InitializeContext(client.InitCtxFlags(0))
if err == nil {
t.Fatal("The instance should return an error when not default or simulation.")
t.Error("The instance should return an error when not default or simulation.")
} else if !errors.Is(err, client.StatusInvalidArgument) {
t.Fatalf("Incorrect error type. Should return %q, but returned %q", client.StatusInvalidArgument, err)
t.Errorf("Incorrect error type. Should return %q, but returned %q", client.StatusInvalidArgument, err)
}

// TODO: test exhausting handles. This requires the ability to query how
Expand Down
Loading