mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
chore: Appease gosec linter (#5777)
These happen to be harmless memory aliasing but I guess the linter can't know that and we can't really prove it in general.
This commit is contained in:
parent
4776f62caa
commit
b377208ede
|
@ -529,7 +529,8 @@ func (t TLSConfig) MakeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
|
||||||
certs := caddytls.AllMatchingCertificates(t.ClientCertificateAutomate)
|
certs := caddytls.AllMatchingCertificates(t.ClientCertificateAutomate)
|
||||||
var err error
|
var err error
|
||||||
for _, cert := range certs {
|
for _, cert := range certs {
|
||||||
err = cri.SupportsCertificate(&cert.Certificate)
|
certCertificate := cert.Certificate // avoid taking address of iteration variable (gosec warning)
|
||||||
|
err = cri.SupportsCertificate(&certCertificate)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return &cert.Certificate, nil
|
return &cert.Certificate, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ nextChoice:
|
||||||
if len(p.SerialNumber) > 0 {
|
if len(p.SerialNumber) > 0 {
|
||||||
var found bool
|
var found bool
|
||||||
for _, sn := range p.SerialNumber {
|
for _, sn := range p.SerialNumber {
|
||||||
if cert.Leaf.SerialNumber.Cmp(&sn.Int) == 0 {
|
snInt := sn.Int // avoid taking address of iteration variable (gosec warning)
|
||||||
|
if cert.Leaf.SerialNumber.Cmp(&snInt) == 0 {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user