From d57b63fd31246a740326581fa8d2ef35e62a921a Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 1 Dec 2015 12:12:46 +0800 Subject: [PATCH] fix #466 --- src/encrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encrypt.c b/src/encrypt.c index abd1840a..fd984645 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -1241,7 +1241,7 @@ int ss_decrypt_all(buffer_t *cipher, int method, int auth) static buffer_t tmp = { 0 }; brealloc(&tmp, cipher->len, cipher->capacity); buffer_t *plain = &tmp; - plain->len = cipher->len; + plain->len = cipher->len - iv_len; uint8_t iv[MAX_IV_LENGTH]; memcpy(iv, cipher->array, iv_len);