Removed
Link Here
|
1 |
--- src/net/adapter.cpp.orig |
2 |
+++ src/net/adapter.cpp |
3 |
@@ -27,11 +27,12 @@ |
4 |
#include <pichi/vo/messages.hpp> |
5 |
#include <pichi/vo/options.hpp> |
6 |
|
7 |
-#ifdef DEPRECATED_RFC2818_CLASS |
8 |
+#include <boost/version.hpp> |
9 |
+#if BOOST_VERSION >= 107300 |
10 |
#include <boost/asio/ssl/host_name_verification.hpp> |
11 |
-#else // DEPRECATED_RFC2818_CLASS |
12 |
+#else // BOOST_VERSION >= 107300 |
13 |
#include <boost/asio/ssl/rfc2818_verification.hpp> |
14 |
-#endif // DEPRECATED_RFC2818_CLASS |
15 |
+#endif // BOOST_VERSION >= 107300 |
16 |
|
17 |
using namespace std; |
18 |
namespace asio = boost::asio; |
19 |
@@ -67,11 +68,11 @@ static auto createTlsContext(vo::TlsEgressOption const |
20 |
ctx.load_verify_file(*option.caFile_); |
21 |
else { |
22 |
ctx.set_default_verify_paths(); |
23 |
-#ifdef DEPRECATED_RFC2818_CLASS |
24 |
+#if BOOST_VERSION >= 107300 |
25 |
ctx.set_verify_callback(ssl::host_name_verification{option.serverName_.value_or(serverName)}); |
26 |
-#else // DEPRECATED_RFC2818_CLASS |
27 |
+#else // BOOST_VERSION >= 107300 |
28 |
ctx.set_verify_callback(ssl::rfc2818_verification{option.serverName_.value_or(serverName)}); |
29 |
-#endif // DEPRECATED_RFC2818_CLASS |
30 |
+#endif // BOOST_VERSION >= 107300 |
31 |
} |
32 |
return ctx; |
33 |
} |
34 |
@@ -95,16 +96,10 @@ unique_ptr<Ingress> makeShadowsocksIngress(Socket&& s, |
35 |
psk = {container, |
36 |
crypto::generateKey(option.method_, ConstBuffer<uint8_t>{option.password_}, container)}; |
37 |
switch (option.method_) { |
38 |
-#if MBEDTLS_VERSION_MAJOR < 3 |
39 |
case CryptoMethod::RC4_MD5: |
40 |
return make_unique<SSStreamAdapter<CryptoMethod::RC4_MD5, Socket>>(psk, forward<Socket>(s)); |
41 |
case CryptoMethod::BF_CFB: |
42 |
return make_unique<SSStreamAdapter<CryptoMethod::BF_CFB, Socket>>(psk, forward<Socket>(s)); |
43 |
-#else // MBEDTLS_VERSION_MAJOR < 3 |
44 |
- case CryptoMethod::RC4_MD5: |
45 |
- case CryptoMethod::BF_CFB: |
46 |
- fail(PichiError::SEMANTIC_ERROR, vo::msg::DEPRECATED_METHOD); |
47 |
-#endif // MBEDTLS_VERSION_MAJOR < 3 |
48 |
case CryptoMethod::AES_128_CTR: |
49 |
return make_unique<SSStreamAdapter<CryptoMethod::AES_128_CTR, Socket>>(psk, forward<Socket>(s)); |
50 |
case CryptoMethod::AES_192_CTR: |
51 |
@@ -158,16 +153,10 @@ static unique_ptr<Egress> makeShadowsocksEgress(vo::Sh |
52 |
auto psk = MutableBuffer<uint8_t>{container, len}; |
53 |
|
54 |
switch (option.method_) { |
55 |
-#if MBEDTLS_VERSION_MAJOR < 3 |
56 |
case CryptoMethod::RC4_MD5: |
57 |
return make_unique<SSStreamAdapter<CryptoMethod::RC4_MD5, TCPSocket>>(psk, io); |
58 |
case CryptoMethod::BF_CFB: |
59 |
return make_unique<SSStreamAdapter<CryptoMethod::BF_CFB, TCPSocket>>(psk, io); |
60 |
-#else // MBEDTLS_VERSION_MAJOR < 3 |
61 |
- case CryptoMethod::RC4_MD5: |
62 |
- case CryptoMethod::BF_CFB: |
63 |
- fail(PichiError::SEMANTIC_ERROR, vo::msg::DEPRECATED_METHOD); |
64 |
-#endif // MBEDTLS_VERSION_MAJOR < 3 |
65 |
case CryptoMethod::AES_128_CTR: |
66 |
return make_unique<SSStreamAdapter<CryptoMethod::AES_128_CTR, TCPSocket>>(psk, io); |
67 |
case CryptoMethod::AES_192_CTR: |