From 4daab0e8690e6e5dc2ff6803dd7e13a1ec745926 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 4 Sep 2015 22:12:04 +0800 Subject: [PATCH] disable iv check for rc4 --- src/encrypt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/encrypt.c b/src/encrypt.c index b337817c5..195d59b2a 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -1276,11 +1276,13 @@ char * ss_decrypt(int buf_size, char *ciphertext, ssize_t *len, ctx->counter = 0; ctx->init = 1; - if (cache_key_exist(iv_cache, (char *)iv, iv_len)) { - free(ciphertext); - return NULL; - } else { - cache_insert(iv_cache, (char *)iv, iv_len, NULL); + if (enc_method >= RC4_MD5) { + if (cache_key_exist(iv_cache, (char *)iv, iv_len)) { + free(ciphertext); + return NULL; + } else { + cache_insert(iv_cache, (char *)iv, iv_len, NULL); + } } }