Skip to content

Commit

Permalink
chore(Device.SslDecrypt): Use util.Copy()
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmog committed Nov 19, 2021
1 parent 619d924 commit 90c6c27
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions dev/ssldecrypt/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,9 @@ func (o *Config) Copy(s Config) {
o.ForwardTrustCertificateEcdsa = s.ForwardTrustCertificateEcdsa
o.ForwardUntrustCertificateRsa = s.ForwardUntrustCertificateRsa
o.ForwardUntrustCertificateEcdsa = s.ForwardUntrustCertificateEcdsa
if s.RootCaExcludes == nil {
o.RootCaExcludes = nil
} else {
o.RootCaExcludes = make([]string, 0, len(s.RootCaExcludes))
copy(o.RootCaExcludes, s.RootCaExcludes)
}
if s.TrustedRootCas == nil {
o.TrustedRootCas = nil
} else {
o.TrustedRootCas = make([]string, 0, len(s.TrustedRootCas))
copy(o.TrustedRootCas, s.TrustedRootCas)
}
if s.DisabledPredefinedExcludeCertificates == nil {
o.DisabledPredefinedExcludeCertificates = nil
} else {
o.DisabledPredefinedExcludeCertificates = make([]string, 0, len(s.DisabledPredefinedExcludeCertificates))
copy(o.DisabledPredefinedExcludeCertificates, s.DisabledPredefinedExcludeCertificates)
}
o.RootCaExcludes = util.CopyStringSlice(s.RootCaExcludes)
o.TrustedRootCas = util.CopyStringSlice(s.TrustedRootCas)
o.DisabledPredefinedExcludeCertificates = util.CopyStringSlice(s.DisabledPredefinedExcludeCertificates)
if s.SslDecryptExcludeCertificates == nil {
o.SslDecryptExcludeCertificates = nil
} else {
Expand Down

0 comments on commit 90c6c27

Please sign in to comment.