From a2366da1a6c65d26933ea7e71ec9dbfdb3a43c04 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sun, 8 Sep 2013 16:12:28 +0800 Subject: [PATCH] fix #15 --- src/encrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encrypt.c b/src/encrypt.c index 897433f4..7a95a4f8 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -262,6 +262,7 @@ char* ss_encrypt(int buf_size, char *plaintext, ssize_t *len, struct enc_ctx *ct RAND_bytes(iv, iv_len); EVP_CipherInit_ex(&ctx->evp, NULL, NULL, enc_key, iv, 1); memcpy(ciphertext, iv, iv_len); + ctx->init = 1; #ifdef DEBUG dump("IV", iv); #endif @@ -301,7 +302,6 @@ char* ss_decrypt_all(int buf_size, char *ciphertext, ssize_t *len, int method) { if (method > TABLE) { - const EVP_CIPHER *cipher = EVP_get_cipherbyname(supported_ciphers[method]); if (cipher == NULL) {