2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-24 21:57:41 +00:00

Remove check for minimum buffer length

This commit is contained in:
Alexander Neumann 2014-11-23 23:02:15 +01:00
parent 719e121c74
commit 79a1ad50ee

4
key.go
View File

@ -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
}