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