fix: encrypt checksums in metadata (#15620)

This commit is contained in:
Klaus Post
2022-08-31 17:13:23 +02:00
committed by GitHub
parent dec942beb6
commit 8e4a45ec41
14 changed files with 118 additions and 162 deletions

View File

@@ -215,7 +215,10 @@ func NewChecksumString(alg, value string) *Checksum {
// AppendTo will append the checksum to b.
// ReadCheckSums reads the values back.
func (c Checksum) AppendTo(b []byte) []byte {
func (c *Checksum) AppendTo(b []byte) []byte {
if c == nil {
return nil
}
var tmp [binary.MaxVarintLen32]byte
n := binary.PutUvarint(tmp[:], uint64(c.Type))
crc := c.Raw()