forked from TrueCloudLab/restic
Correct length of plaintext before decryption
This commit is contained in:
parent
2462f93533
commit
68141c738b
1 changed files with 1 additions and 1 deletions
2
key.go
2
key.go
|
@ -498,8 +498,8 @@ func (k *Key) decrypt(ks *keys, plaintext, ciphertext []byte) ([]byte, error) {
|
||||||
|
|
||||||
// decrypt
|
// decrypt
|
||||||
e := cipher.NewCTR(c, iv)
|
e := cipher.NewCTR(c, iv)
|
||||||
e.XORKeyStream(plaintext, ciphertext)
|
|
||||||
plaintext = plaintext[:len(ciphertext)]
|
plaintext = plaintext[:len(ciphertext)]
|
||||||
|
e.XORKeyStream(plaintext, ciphertext)
|
||||||
|
|
||||||
return plaintext, nil
|
return plaintext, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue