forked from TrueCloudLab/restic
Correctly deal with empty files
This commit is contained in:
parent
6d56d7d4c6
commit
c0b3021494
3 changed files with 6 additions and 6 deletions
2
key.go
2
key.go
|
@ -374,7 +374,7 @@ func (k *Key) Encrypt(ciphertext, plaintext []byte) (int, error) {
|
|||
// IV || Ciphertext || HMAC.
|
||||
func (k *Key) decrypt(ks *keys, ciphertext []byte) ([]byte, error) {
|
||||
// check for plausible length
|
||||
if len(ciphertext) <= ivSize+hmacSize {
|
||||
if len(ciphertext) < ivSize+hmacSize {
|
||||
panic("trying to decryipt invalid data: ciphertext too small")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue