Skip to content

Commit

Permalink
Merge pull request #765 from atc0005/i764-fix-unused-parameter-lintin…
Browse files Browse the repository at this point in the history
…g-error

Fix linting error and potential race condition
  • Loading branch information
atc0005 authored Feb 12, 2024
2 parents 24f3951 + 46d4bd4 commit dbecdf5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cmd/certsum/certcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func certScanner(

go func(
ctx context.Context,
portscanResult netutils.PortCheckResult,
psResult netutils.PortCheckResult,
timeout time.Duration,
resultsChan chan<- certs.DiscoveredCertChain,
log zerolog.Logger,
Expand Down Expand Up @@ -228,9 +228,9 @@ func certScanner(

var certFetchErr error
log.Debug().
Str("host", portScanResult.Host).
Str("ip_address", portScanResult.IPAddress.String()).
Int("port", portScanResult.Port).
Str("host", psResult.Host).
Str("ip_address", psResult.IPAddress.String()).
Int("port", psResult.Port).
Msg("Retrieving certificate chain")

// NOTE: We explicitly specify the IP Address to prevent
Expand All @@ -239,9 +239,9 @@ func certScanner(
// of using a name/FQDN to open the connection) to
// retrieve the certificate chain.
certChain, certFetchErr := netutils.GetCerts(
portScanResult.Host,
portScanResult.IPAddress.String(),
portScanResult.Port,
psResult.Host,
psResult.IPAddress.String(),
psResult.Port,
timeout,
log,
)
Expand All @@ -253,9 +253,9 @@ func certScanner(
}
log.Error().
Err(certFetchErr).
Str("host", portScanResult.Host).
Str("ip_address", portScanResult.IPAddress.String()).
Int("port", portScanResult.Port).
Str("host", psResult.Host).
Str("ip_address", psResult.IPAddress.String()).
Int("port", psResult.Port).
Msg("error fetching certificates chain")

// os.Exit(1)
Expand All @@ -266,9 +266,9 @@ func certScanner(

log.Debug().Msg("Attempting to send cert chain on resultsChan")
resultsChan <- certs.DiscoveredCertChain{
Name: portScanResult.Host,
IPAddress: portScanResult.IPAddress.String(),
Port: portScanResult.Port,
Name: psResult.Host,
IPAddress: psResult.IPAddress.String(),
Port: psResult.Port,
Certs: certChain,
}

Expand Down

0 comments on commit dbecdf5

Please # to comment.