mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Add TLS cert checksum (#18557)
It allows validation of whether all certs match across clusters.
This commit is contained in:
parent
879d5dd236
commit
94fbcd8ebe
@ -60,6 +60,7 @@ import (
|
|||||||
xnet "github.com/minio/pkg/v2/net"
|
xnet "github.com/minio/pkg/v2/net"
|
||||||
"github.com/minio/pkg/v2/policy"
|
"github.com/minio/pkg/v2/policy"
|
||||||
"github.com/secure-io/sio-go"
|
"github.com/secure-io/sio-go"
|
||||||
|
"github.com/zeebo/xxh3"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -2500,11 +2501,27 @@ func getTLSInfo() madmin.TLSInfo {
|
|||||||
|
|
||||||
if globalIsTLS {
|
if globalIsTLS {
|
||||||
for _, c := range globalPublicCerts {
|
for _, c := range globalPublicCerts {
|
||||||
|
check := xxh3.Hash(c.RawIssuer)
|
||||||
|
check ^= xxh3.Hash(c.RawSubjectPublicKeyInfo)
|
||||||
|
// We XOR, so order doesn't matter.
|
||||||
|
for _, v := range c.DNSNames {
|
||||||
|
check ^= xxh3.HashString(v)
|
||||||
|
}
|
||||||
|
for _, v := range c.EmailAddresses {
|
||||||
|
check ^= xxh3.HashString(v)
|
||||||
|
}
|
||||||
|
for _, v := range c.IPAddresses {
|
||||||
|
check ^= xxh3.HashString(v.String())
|
||||||
|
}
|
||||||
|
for _, v := range c.URIs {
|
||||||
|
check ^= xxh3.HashString(v.String())
|
||||||
|
}
|
||||||
tlsInfo.Certs = append(tlsInfo.Certs, madmin.TLSCert{
|
tlsInfo.Certs = append(tlsInfo.Certs, madmin.TLSCert{
|
||||||
PubKeyAlgo: c.PublicKeyAlgorithm.String(),
|
PubKeyAlgo: c.PublicKeyAlgorithm.String(),
|
||||||
SignatureAlgo: c.SignatureAlgorithm.String(),
|
SignatureAlgo: c.SignatureAlgorithm.String(),
|
||||||
NotBefore: c.NotBefore,
|
NotBefore: c.NotBefore,
|
||||||
NotAfter: c.NotAfter,
|
NotAfter: c.NotAfter,
|
||||||
|
Checksum: strconv.FormatUint(check, 16),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
go.mod
2
go.mod
@ -49,7 +49,7 @@ require (
|
|||||||
github.com/minio/dperf v0.5.2
|
github.com/minio/dperf v0.5.2
|
||||||
github.com/minio/highwayhash v1.0.2
|
github.com/minio/highwayhash v1.0.2
|
||||||
github.com/minio/kes-go v0.2.0
|
github.com/minio/kes-go v0.2.0
|
||||||
github.com/minio/madmin-go/v3 v3.0.34
|
github.com/minio/madmin-go/v3 v3.0.35-0.20231130082526-199918d0ff20
|
||||||
github.com/minio/minio-go/v7 v7.0.65-0.20231122233251-1f7dd6b7e3e1
|
github.com/minio/minio-go/v7 v7.0.65-0.20231122233251-1f7dd6b7e3e1
|
||||||
github.com/minio/mux v1.9.0
|
github.com/minio/mux v1.9.0
|
||||||
github.com/minio/pkg/v2 v2.0.4
|
github.com/minio/pkg/v2 v2.0.4
|
||||||
|
4
go.sum
4
go.sum
@ -449,8 +449,8 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
|
|||||||
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||||
github.com/minio/kes-go v0.2.0 h1:HA33arq9s3MErbsj3PAXFVfFo4U4yw7lTKQ5kWFrpCA=
|
github.com/minio/kes-go v0.2.0 h1:HA33arq9s3MErbsj3PAXFVfFo4U4yw7lTKQ5kWFrpCA=
|
||||||
github.com/minio/kes-go v0.2.0/go.mod h1:VorHLaIYis9/MxAHAtXN4d8PUMNKhIxTIlvFt0hBOEo=
|
github.com/minio/kes-go v0.2.0/go.mod h1:VorHLaIYis9/MxAHAtXN4d8PUMNKhIxTIlvFt0hBOEo=
|
||||||
github.com/minio/madmin-go/v3 v3.0.34 h1:MGPQYIWm52liSubofK24FhrznPYnRpQrDNddZJEyBPA=
|
github.com/minio/madmin-go/v3 v3.0.35-0.20231130082526-199918d0ff20 h1:5kfjAypPN18QOOQaZjR3jfGzXyIwzLdKMS7d/cPY3Wc=
|
||||||
github.com/minio/madmin-go/v3 v3.0.34/go.mod h1:4QN2NftLSV7MdlT50dkrenOMmNVHluxTvlqJou3hte8=
|
github.com/minio/madmin-go/v3 v3.0.35-0.20231130082526-199918d0ff20/go.mod h1:4QN2NftLSV7MdlT50dkrenOMmNVHluxTvlqJou3hte8=
|
||||||
github.com/minio/mc v0.0.0-20231127112613-5e6ae2172e25 h1:8jT9Tz4opgrX6mnyFWW+TQ90AnrJqJ0mzeFXUWDHNGo=
|
github.com/minio/mc v0.0.0-20231127112613-5e6ae2172e25 h1:8jT9Tz4opgrX6mnyFWW+TQ90AnrJqJ0mzeFXUWDHNGo=
|
||||||
github.com/minio/mc v0.0.0-20231127112613-5e6ae2172e25/go.mod h1:8kat72LmpzZ2/xykDcq64tcRRJkkWo1Kd/Z5coC6t0w=
|
github.com/minio/mc v0.0.0-20231127112613-5e6ae2172e25/go.mod h1:8kat72LmpzZ2/xykDcq64tcRRJkkWo1Kd/Z5coC6t0w=
|
||||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||||
|
Loading…
Reference in New Issue
Block a user