From 982561e18bc823c03eb1d59dbabcf240f42f9806 Mon Sep 17 00:00:00 2001 From: Junjie Gao Date: Fri, 13 Sep 2024 02:22:42 +0000 Subject: [PATCH] fix: update Signed-off-by: Junjie Gao --- revocation/internal/crl/crl.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/revocation/internal/crl/crl.go b/revocation/internal/crl/crl.go index 40b31793..7ebb6f5e 100644 --- a/revocation/internal/crl/crl.go +++ b/revocation/internal/crl/crl.go @@ -90,11 +90,11 @@ 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 ( - serverResults []*result.ServerResult + serverResults = make([]*result.ServerResult, len(cert.CRLDistributionPoints)) lastErr error crlURL string ) - for _, crlURL = range cert.CRLDistributionPoints { + for i, crlURL := range cert.CRLDistributionPoints { baseCRL, err := download(ctx, crlURL, opts.HTTPClient) if err != nil { lastErr = fmt.Errorf("failed to download CRL from %s: %w", crlURL, err) @@ -119,7 +119,7 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C } } - serverResults = append(serverResults, crlResult) + serverResults[i] = crlResult } if lastErr != nil {