poco:add package for the Poco C++ library
[feed/packages.git] / net / shadowsocks-client / patches / 100-fortify-source-compat.patch
1 --- a/client.c
2 +++ b/client.c
3 @@ -111,7 +111,7 @@ int client_do_local_read(int sockfd, str
4 goto out;
5 }
6
7 - if (encrypt(sockfd, ln) == -1)
8 + if (crypto_encrypt(sockfd, ln) == -1)
9 goto out;
10
11 ret = do_send(ln->server_sockfd, ln, "cipher", 0);
12 @@ -172,7 +172,7 @@ int client_do_server_read(int sockfd, st
13 }
14 }
15
16 - if (decrypt(sockfd, ln) == -1)
17 + if (crypto_decrypt(sockfd, ln) == -1)
18 goto out;
19
20 if (ln->state & SS_UDP) {
21 --- a/crypto.c
22 +++ b/crypto.c
23 @@ -185,7 +185,7 @@ err:
24 return -1;
25 }
26
27 -int encrypt(int sockfd, struct link *ln)
28 +int crypto_encrypt(int sockfd, struct link *ln)
29 {
30 int len, cipher_len;
31 EVP_CIPHER_CTX *ctx_p;
32 @@ -223,7 +223,7 @@ err:
33 return -1;
34 }
35
36 -int decrypt(int sockfd, struct link *ln)
37 +int crypto_decrypt(int sockfd, struct link *ln)
38 {
39 int len, text_len;
40 EVP_CIPHER_CTX *ctx_p;
41 --- a/crypto.h
42 +++ b/crypto.h
43 @@ -15,7 +15,7 @@ extern int iv_len;
44
45 int crypto_init(char *key, char *method);
46 void crypto_exit(void);
47 -int encrypt(int sockfd, struct link *ln);
48 -int decrypt(int sockfd, struct link *ln);
49 +int crypto_encrypt(int sockfd, struct link *ln);
50 +int crypto_decrypt(int sockfd, struct link *ln);
51
52 #endif
53 --- a/server.c
54 +++ b/server.c
55 @@ -36,7 +36,7 @@ int server_do_remote_read(int sockfd, st
56 goto out;
57 }
58
59 - if (encrypt(sockfd, ln) == -1)
60 + if (crypto_encrypt(sockfd, ln) == -1)
61 goto out;
62
63 ret = do_send(ln->local_sockfd, ln, "cipher", 0);
64 @@ -91,7 +91,7 @@ int server_do_local_read(int sockfd, str
65 }
66 }
67
68 - if (decrypt(sockfd, ln) == -1)
69 + if (crypto_decrypt(sockfd, ln) == -1)
70 goto out;
71
72 if (ln->state & SS_UDP) {