fix iv cache

This commit is contained in:
Max Lv
2015-09-02 19:41:41 +08:00
parent 5a52a97bd4
commit e686d6594f
2 changed files with 19 additions and 11 deletions
+2 -2
View File
@@ -1267,11 +1267,11 @@ 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, MAX_IV_LENGTH)) {
if (cache_key_exist(iv_cache, (char *)iv, iv_len)) {
free(ciphertext);
return NULL;
} else {
cache_insert(iv_cache, (char *)iv, MAX_IV_LENGTH, NULL);
cache_insert(iv_cache, (char *)iv, iv_len, NULL);
}
}