Skip to content

Commit

Permalink
Fix SSE-C replication checksum
Browse files Browse the repository at this point in the history
`minio-go` renames the header. Fix in minio/minio-go#1970

Bonus 1: This also renames the header, in line with other replication headers.
Bonus 2: Improve error message when local host not found in ellipsis.
  • Loading branch information
klauspost committed Jun 10, 2024
1 parent a0e4dd2 commit 9a39721
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/bucket-replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const (
ObjectLockLegalHoldTimestamp = "objectlock-legalhold-timestamp"

// ReplicationSsecChecksumHeader - the encrypted checksum of the SSE-C encrypted object.
ReplicationSsecChecksumHeader = ReservedMetadataPrefix + "Ssec-Crc"
ReplicationSsecChecksumHeader = "X-Minio-Replication-Ssec-Crc"
)

// gets replication config associated to a given bucket name.
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,5 @@ require (
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

replace github.com/minio/minio-go/v7 => github.com/klauspost/minio-go/v7 v7.0.0-20240610151036-c0365cc82d05
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuV
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/filepathx v1.1.1 h1:201zvAsL1PhZvmXTP+QLer3AavWrO3U1NILWpniHK4w=
github.com/klauspost/filepathx v1.1.1/go.mod h1:XWxdp8rEw4gupPBrxrV5Q57dL/71xj0OgV1gKt2zTfU=
github.com/klauspost/minio-go/v7 v7.0.0-20240610151036-c0365cc82d05 h1:pwqUZC0fMw1lwfykWN1itzI4mkUPjE9E8zRtsltdjFk=
github.com/klauspost/minio-go/v7 v7.0.0-20240610151036-c0365cc82d05/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo=
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/klauspost/readahead v1.4.0 h1:w4hQ3BpdLjBnRQkZyNi+nwdHU7eGP9buTexWK9lU7gY=
Expand Down Expand Up @@ -461,8 +463,6 @@ github.com/minio/mc v0.0.0-20240605181330-17adf0abbbca/go.mod h1:21/cb+wUd+lLRsd
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v6 v6.0.46/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg=
github.com/minio/minio-go/v7 v7.0.70 h1:1u9NtMgfK1U42kUxcsl5v0yj6TEOPR497OAQxpJnn2g=
github.com/minio/minio-go/v7 v7.0.70/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo=
github.com/minio/mux v1.9.0 h1:dWafQFyEfGhJvK6AwLOt83bIG5bxKxKJnKMCi0XAaoA=
github.com/minio/mux v1.9.0/go.mod h1:1pAare17ZRL5GpmNL+9YmqHoWnLmMZF9C/ioUCfy0BQ=
github.com/minio/pkg/v2 v2.0.19 h1:r187/k/oVH9H0DDwvLY5WipkJaZ4CLd4KI3KgIUExR0=
Expand Down
2 changes: 1 addition & 1 deletion internal/crypto/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
MetaDataEncryptionKey = "X-Minio-Internal-Server-Side-Encryption-S3-Kms-Sealed-Key"

// MetaSsecCRC is the encrypted checksum of the SSE-C encrypted object.
MetaSsecCRC = "X-Minio-Internal-Ssec-Crc"
MetaSsecCRC = "X-Minio-Replication-Ssec-Crc"

// MetaContext is the KMS context provided by a client when encrypting an
// object with SSE-KMS. A client may not send a context in which case the
Expand Down
2 changes: 1 addition & 1 deletion internal/grid/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func NewManager(ctx context.Context, o ManagerOptions) (*Manager, error) {
})
}
if !found {
return nil, fmt.Errorf("grid: local host not found")
return nil, fmt.Errorf("grid: local host (%s) not found in cluster setup", o.Local)
}

return m, nil
Expand Down

0 comments on commit 9a39721

Please sign in to comment.