mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-30 05:11:14 +00:00
fix #441
This commit is contained in:
+7
-2
@@ -1229,12 +1229,17 @@ char * ss_encrypt(int buf_size, char *plaintext, ssize_t *len,
|
||||
char * ss_decrypt_all(int buf_size, char *ciphertext, ssize_t *len, int method, int auth)
|
||||
{
|
||||
if (method > TABLE) {
|
||||
cipher_ctx_t evp;
|
||||
cipher_context_init(&evp, method, 0);
|
||||
size_t iv_len = enc_iv_len;
|
||||
size_t c_len = *len, p_len = *len - iv_len;
|
||||
int ret = 1;
|
||||
|
||||
if (*len < iv_len) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cipher_ctx_t evp;
|
||||
cipher_context_init(&evp, method, 0);
|
||||
|
||||
static int tmp_len = 0;
|
||||
static char *tmp_buf = NULL;
|
||||
int buf_len = max(p_len, buf_size);
|
||||
|
||||
Reference in New Issue
Block a user