You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.6 KiB

  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. - if (encrypt(sockfd, ln) == -1)
  7. + if (crypto_encrypt(sockfd, ln) == -1)
  8. goto out;
  9. ret = do_send(ln->server_sockfd, ln, "cipher", 0);
  10. @@ -172,7 +172,7 @@ int client_do_server_read(int sockfd, st
  11. }
  12. }
  13. - if (decrypt(sockfd, ln) == -1)
  14. + if (crypto_decrypt(sockfd, ln) == -1)
  15. goto out;
  16. if (ln->state & SS_UDP) {
  17. --- a/crypto.c
  18. +++ b/crypto.c
  19. @@ -185,7 +185,7 @@ err:
  20. return -1;
  21. }
  22. -int encrypt(int sockfd, struct link *ln)
  23. +int crypto_encrypt(int sockfd, struct link *ln)
  24. {
  25. int len, cipher_len;
  26. EVP_CIPHER_CTX *ctx_p;
  27. @@ -223,7 +223,7 @@ err:
  28. return -1;
  29. }
  30. -int decrypt(int sockfd, struct link *ln)
  31. +int crypto_decrypt(int sockfd, struct link *ln)
  32. {
  33. int len, text_len;
  34. EVP_CIPHER_CTX *ctx_p;
  35. --- a/crypto.h
  36. +++ b/crypto.h
  37. @@ -15,7 +15,7 @@ extern int iv_len;
  38. int crypto_init(char *key, char *method);
  39. void crypto_exit(void);
  40. -int encrypt(int sockfd, struct link *ln);
  41. -int decrypt(int sockfd, struct link *ln);
  42. +int crypto_encrypt(int sockfd, struct link *ln);
  43. +int crypto_decrypt(int sockfd, struct link *ln);
  44. #endif
  45. --- a/server.c
  46. +++ b/server.c
  47. @@ -36,7 +36,7 @@ int server_do_remote_read(int sockfd, st
  48. goto out;
  49. }
  50. - if (encrypt(sockfd, ln) == -1)
  51. + if (crypto_encrypt(sockfd, ln) == -1)
  52. goto out;
  53. ret = do_send(ln->local_sockfd, ln, "cipher", 0);
  54. @@ -91,7 +91,7 @@ int server_do_local_read(int sockfd, str
  55. }
  56. }
  57. - if (decrypt(sockfd, ln) == -1)
  58. + if (crypto_decrypt(sockfd, ln) == -1)
  59. goto out;
  60. if (ln->state & SS_UDP) {