mirror of
https://github.com/kopia/kopia.git
synced 2026-03-27 10:32:08 -04:00
hotfix: kopia-0.5.0 did not properly support 256-bit hashes
This commit is contained in:
@@ -384,10 +384,15 @@ func (bm *lockFreeManager) encryptAndWriteContentNotLocked(ctx context.Context,
|
||||
hash := bm.hashData(data)
|
||||
blobID := prefix + blob.ID(hex.EncodeToString(hash))
|
||||
|
||||
iv, err := getIndexBlobIV(blobID)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "unable to get IV from index blob")
|
||||
}
|
||||
|
||||
// Encrypt the content in-place.
|
||||
atomic.AddInt64(&bm.stats.EncryptedBytes, int64(len(data)))
|
||||
|
||||
data2, err := bm.encryptor.Encrypt(data, hash)
|
||||
data2, err := bm.encryptor.Encrypt(data, iv)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user