Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Aug 22, 2024
1 parent d643ea2 commit c620d85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions revocation/internal/crl/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
// CRL not enabled for this certificate.
return &result.CertRevocationResult{
Result: result.ResultNonRevokable,
CRLResults: []*result.CRLResult{
{Result: result.ResultNonRevokable},
},
CRLResults: []*result.CRLResult{{
Result: result.ResultNonRevokable,
}},
}
}

Expand Down
8 changes: 8 additions & 0 deletions revocation/internal/crl/crl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ import (
)

func TestCertCheckStatus(t *testing.T) {
t.Run("certtificate does not have CRLDistributionPoints", func(t *testing.T) {
cert := &x509.Certificate{}
r := CertCheckStatus(context.Background(), cert, &x509.Certificate{}, CertCheckStatusOptions{})
if r.Result != result.ResultNonRevokable {
t.Fatalf("expected NonRevokable, got %s", r.Result)
}
})

t.Run("download error", func(t *testing.T) {
cert := &x509.Certificate{
CRLDistributionPoints: []string{"http://example.com"},
Expand Down

0 comments on commit c620d85

Please sign in to comment.