Line 0
Link Here
|
|
|
1 |
--- source/crypto.c.orig 2018-10-09 12:46:55 UTC |
2 |
+++ source/crypto.c |
3 |
@@ -282,9 +282,9 @@ static char * decipher_evp (const unsigned char *passw |
4 |
unsigned char *iv = NULL; |
5 |
unsigned long errcode; |
6 |
int outlen2; |
7 |
- EVP_CIPHER_CTX a; |
8 |
- EVP_CIPHER_CTX_init(&a); |
9 |
- EVP_CIPHER_CTX_set_padding(&a, 0); |
10 |
+ EVP_CIPHER_CTX *a; |
11 |
+ EVP_CIPHER_CTX_init(a); |
12 |
+ EVP_CIPHER_CTX_set_padding(a, 0); |
13 |
|
14 |
if (ivsize > 0) |
15 |
iv = new_malloc(ivsize); |
16 |
@@ -292,18 +292,18 @@ static char * decipher_evp (const unsigned char *passw |
17 |
if (ivsize > 0) |
18 |
memcpy(iv, ciphertext, ivsize); |
19 |
|
20 |
- EVP_DecryptInit_ex(&a, type, NULL, NULL, iv); |
21 |
+ EVP_DecryptInit_ex(a, type, NULL, NULL, iv); |
22 |
EVP_CIPHER_CTX_set_key_length(&a, passwdlen); |
23 |
- EVP_CIPHER_CTX_set_padding(&a, 0); |
24 |
- EVP_DecryptInit_ex(&a, NULL, NULL, passwd, NULL); |
25 |
+ EVP_CIPHER_CTX_set_padding(a, 0); |
26 |
+ EVP_DecryptInit_ex(a, NULL, NULL, passwd, NULL); |
27 |
|
28 |
- if (EVP_DecryptUpdate(&a, outbuf, outlen, ciphertext, cipherlen) != 1) |
29 |
+ if (EVP_DecryptUpdate(a, outbuf, outlen, ciphertext, cipherlen) != 1) |
30 |
yell("EVP_DecryptUpdate died."); |
31 |
- if (EVP_DecryptFinal_ex(&a, outbuf + (*outlen), &outlen2) != 1) |
32 |
+ if (EVP_DecryptFinal_ex(a, outbuf + (*outlen), &outlen2) != 1) |
33 |
yell("EVP_DecryptFinal_Ex died."); |
34 |
*outlen += outlen2; |
35 |
|
36 |
- EVP_CIPHER_CTX_cleanup(&a); |
37 |
+ EVP_CIPHER_CTX_cleanup(a); |
38 |
|
39 |
ERR_load_crypto_strings(); |
40 |
while ((errcode = ERR_get_error())) |
41 |
@@ -454,8 +454,8 @@ static char * cipher_evp (const unsigned char *passwd, |
42 |
unsigned long errcode; |
43 |
u_32int_t randomval; |
44 |
int iv_count; |
45 |
- EVP_CIPHER_CTX a; |
46 |
- EVP_CIPHER_CTX_init(&a); |
47 |
+ EVP_CIPHER_CTX *a; |
48 |
+ EVP_CIPHER_CTX_init(a); |
49 |
EVP_CIPHER_CTX_set_padding(&a, 0); |
50 |
|
51 |
if (ivsize < 0) |