commit 38b1cf314e5581a6190882cf185f6114837e9434
parent 11c9408690aeb2df2ceb7629eea2c9b489cba8d2
Author: Jo-Philipp Wich <jow@openwrt.org>
Date: Thu, 2 Jul 2015 10:01:55 +0200
Merge pull request #1471 from jow-/shadowsocks-fortify-compat
shadowsocks-client: fix fortify source compatibility
Diffstat:
1 file changed, 72 insertions(+), 0 deletions(-)
diff --git a/net/shadowsocks-client/patches/100-fortify-source-compat.patch b/net/shadowsocks-client/patches/100-fortify-source-compat.patch
@@ -0,0 +1,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) {