mirror of https://github.com/restic/restic.git
Remove check for minimum buffer length
This commit is contained in:
parent
719e121c74
commit
79a1ad50ee
4
key.go
4
key.go
|
@ -257,10 +257,6 @@ func (k *Key) newIV(buf []byte) error {
|
|||
// HMAC. Encrypt returns the ciphertext's length. For the hash function, SHA256
|
||||
// is used, so the overhead is 16+32=48 byte.
|
||||
func (k *Key) encrypt(ks *keys, ciphertext, plaintext []byte) (int, error) {
|
||||
if cap(ciphertext) < maxCiphertextSize {
|
||||
panic("encryption buffer is too small")
|
||||
}
|
||||
|
||||
if cap(ciphertext) < len(plaintext)+ivSize+hmacSize {
|
||||
return 0, ErrBufferTooSmall
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue