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 Sep 13, 2024
1 parent 5aa15e0 commit e2b246d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions revocation/internal/crl/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

// RevocationMethodCRL represents the CRL revocation method
const RevocationMethodCRL = 2
const RevocationMethodCRL int = 2

var (
// oidFreshestCRL is the object identifier for the distribution point
Expand Down Expand Up @@ -90,9 +90,9 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
// point with one CRL URI, which will be cached, so checking all the URIs is
// not a performance issue.
var (
results []*result.ServerResult
lastErr error
crlURL string
serverResults []*result.ServerResult
lastErr error
crlURL string
)
for _, crlURL = range cert.CRLDistributionPoints {
baseCRL, err := download(ctx, crlURL, opts.HTTPClient)
Expand All @@ -119,7 +119,7 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
}
}

results = append(results, crlResult)
serverResults = append(serverResults, crlResult)
}

if lastErr != nil {
Expand All @@ -138,7 +138,7 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C

return &result.CertRevocationResult{
Result: result.ResultOK,
ServerResults: results,
ServerResults: serverResults,
RevocationMethod: RevocationMethodCRL,
}
}
Expand Down
2 changes: 1 addition & 1 deletion revocation/internal/ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
)

// RevocationMethodOCSP represents the OCSP revocation method
const RevocationMethodOCSP = 1
const RevocationMethodOCSP int = 1

// CertCheckStatusOptions specifies values that are needed to check OCSP revocation
type CertCheckStatusOptions struct {
Expand Down
6 changes: 3 additions & 3 deletions revocation/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const (

// MethodOCSP represents OCSP as the method used to check the
// revocation status of a certificate
MethodOCSP = ocsp.RevocationMethodOCSP
MethodOCSP int = ocsp.RevocationMethodOCSP

// MethodCRL represents CRL as the method used to check the
// revocation status of a certificate
MethodCRL = crl.RevocationMethodCRL
MethodCRL int = crl.RevocationMethodCRL

// MethodOCSPFallbackCRL represents OCSP check with unknown error
// fallback to CRL as the method used to check the revocation status of a
// certificate
MethodOCSPFallbackCRL = 3
MethodOCSPFallbackCRL int = 3
)

0 comments on commit e2b246d

Please sign in to comment.