View | Details | Raw Unified | Return to bug 270934 | Differences between
and this patch

Collapse All | Expand All

(-)b/net/pichi/Makefile (-3 / +23 lines)
Lines 1-5 Link Here
1
PORTNAME=	pichi
1
PORTNAME=	pichi
2
DISTVERSION=	1.4.0
2
DISTVERSION=	1.5.0
3
PORTREVISION=	3
3
PORTREVISION=	3
4
CATEGORIES=	net
4
CATEGORIES=	net
5
5
Lines 26-39 PLIST_SUB= DISTVERSION=${DISTVERSION} Link Here
26
CMAKE_BUILD_TYPE=	MinSizeRel
26
CMAKE_BUILD_TYPE=	MinSizeRel
27
CMAKE_ARGS=		-DVERSION=${DISTVERSION}
27
CMAKE_ARGS=		-DVERSION=${DISTVERSION}
28
CMAKE_ON=		BUILD_SERVER BUILD_TEST
28
CMAKE_ON=		BUILD_SERVER BUILD_TEST
29
CMAKE_OFF=	ENABLE_CONAN TRANSPARENT_IPTABLES
29
INSTALL_TARGET=		install/strip
30
INSTALL_TARGET=		install/strip
30
TEST_TARGET=		test
31
TEST_TARGET=		test
31
32
32
OPTIONS_DEFINE=		DEVEL STATIC
33
OPTIONS_DEFINE=		DEVEL STATIC TLS_FINGERPRINT TRANSPARENT
33
OPTIONS_SUB=		yes
34
OPTIONS_SUB=		yes
34
35
35
STATIC_DESC=		Static linking
36
STATIC_DESC=		Static linking
36
STATIC_CMAKE_BOOL=	STATIC_LINK
37
STATIC_CMAKE_BOOL_OFF=	BUILD_SHARED_LIBS
37
STATIC_BUILD_DEPENDS=	boost-libs>=1.67.0:devel/boost-libs \
38
STATIC_BUILD_DEPENDS=	boost-libs>=1.67.0:devel/boost-libs \
38
			libmaxminddb>=1.3.0:net/libmaxminddb \
39
			libmaxminddb>=1.3.0:net/libmaxminddb \
39
			libsodium>=1.0.12:security/libsodium \
40
			libsodium>=1.0.12:security/libsodium \
Lines 52-64 STATIC_USE_OFF= LDCONFIG=yes Link Here
52
DEVEL_DESC=		Install development files
53
DEVEL_DESC=		Install development files
53
DEVEL_CMAKE_BOOL=	INSTALL_DEVEL
54
DEVEL_CMAKE_BOOL=	INSTALL_DEVEL
54
55
56
TLS_FINGERPRINT_DESC=		Simulate TLS fingerprint of Google Chrome
57
TLS_FINGERPRINT_CMAKE_BOOL=	TLS_FINGERPRINT
58
59
TRANSPARENT_DESC=		Enable transparent ingress feature
60
TRANSPARENT_CMAKE_BOOL=		TRANSPARENT_PF
61
55
.include <bsd.port.options.mk>
62
.include <bsd.port.options.mk>
56
63
64
.if ${PORT_OPTIONS:MTLS_FINGERPRINT}
65
.if ${PORT_OPTIONS:MSTATIC}
66
BUILD_DEPENDS+=	brotli>=1.0.0:archivers/brotli \
67
			boringssl>=0.0.0.0.2022.12.22.01:security/boringssl
68
.else
69
LIB_DEPENDS+=	libbrotlicommon.so:archivers/brotli \
70
			libbrotlidec.so:security/boringssl \
71
			libbrotlienc.so:security/boringssl \
72
			libssl.so:security/boringssl \
73
			libcrypto.so:security/boringssl
74
.endif
75
.else
57
.if ${PORT_OPTIONS:MSTATIC}
76
.if ${PORT_OPTIONS:MSTATIC}
58
USES+=		ssl:build
77
USES+=		ssl:build
59
.else
78
.else
60
USES+=		ssl
79
USES+=		ssl
61
.endif
80
.endif
81
.endif
62
82
63
post-install:
83
post-install:
64
	${MKDIR} ${STAGEDIR}${ETCDIR}
84
	${MKDIR} ${STAGEDIR}${ETCDIR}
(-)b/net/pichi/distinfo (-2 / +2 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1627466281
1
TIMESTAMP = 1627466281
2
SHA256 (pichi-router-pichi-1.4.0_GH0.tar.gz) = 9b6cfadb57f80af516fb8a7d6d1199ad1c03f1c5ba0378a223c0733b12b27482
2
SHA256 (pichi-router-pichi-1.5.0_GH0.tar.gz) = b6b69ec74572dcf31484ecad850d809b5f38e7d3978a952951344aff496d3398
3
SIZE (pichi-router-pichi-1.4.0_GH0.tar.gz) = 2081661
3
SIZE (pichi-router-pichi-1.5.0_GH0.tar.gz) = 2124092
(-)a/net/pichi/files/patch-include_pichi_common_config.hpp.in (-79 lines)
Removed Link Here
1
--- include/pichi/common/config.hpp.in.orig
2
+++ include/pichi/common/config.hpp.in
3
@@ -15,48 +15,39 @@
4
 #cmakedefine HAS_SETSID
5
 #cmakedefine HAS_CLOSE
6
 
7
-#cmakedefine NO_IGNORED_ATTRIBUTES_FOR_SODIUM
8
-#cmakedefine DEPRECATED_RFC2818_CLASS
9
+#ifdef __GNUC__
10
 
11
-#cmakedefine DISABLE_SHORTEN_64_TO_32_WARNING
12
-#if defined(DISABLE_SHORTEN_64_TO_32_WARNING) && defined(__clang__)
13
-#pragma clang diagnostic push
14
-#pragma clang diagnostic ignored "-Wshorten-64-to-32"
15
-#include <boost/asio/basic_socket.hpp>
16
-#include <boost/asio/ssl/impl/context.ipp>
17
-#include <boost/beast/zlib/detail/deflate_stream.ipp>
18
-#pragma clang diagnostic pop
19
-#endif  // DISABLE_SHORTEN_64_TO_32_WARNING && __clang__
20
+#if __GNUC__ >= 8
21
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
22
+#endif  // __GNUC__ >= 8
23
 
24
-#ifdef _MSC_VER
25
-#pragma warning(push)
26
-#pragma warning(disable : 4702)
27
-#include <boost/beast/http/fields.hpp>
28
-#pragma warning(pop)
29
-#endif  // _MSC_VER
30
+#cmakedefine DISABLE_GCC_IGNORED_ATTRIBUTES
31
+#ifdef DISABLE_GCC_IGNORED_ATTRIBUTES
32
+#pragma GCC diagnostic ignored "-Wignored-attributes"
33
+#endif  // DISABLE_GCC_IGNORED_ATTRIBUTES
34
 
35
-#cmakedefine HAS_SP_COUNTED_BASE_CLANG_HPP
36
-#if defined(HAS_SP_COUNTED_BASE_CLANG_HPP) && defined(__clang__)
37
-#if !__has_feature(c_atomic)
38
-#pragma clang diagnostic push
39
-#pragma clang diagnostic ignored "-Wc11-extensions"
40
-#include <boost/smart_ptr/detail/sp_counted_base_clang.hpp>
41
-#pragma clang diagnostic pop
42
-#endif  // !__has_feature(c_atomic)
43
-#endif  // HAS_SP_COUNTED_BASE_CLANG_HPP && __clang__
44
+#endif  // __GNUC__
45
 
46
-#cmakedefine DEPRECATED_ALLOCATOR_VOID
47
-#if defined(DEPRECATED_ALLOCATOR_VOID) && defined(__clang__)
48
-#pragma clang diagnostic push
49
+#ifdef __clang__
50
+
51
+#if (defined(__APPLE__) && __clang_major__ >= 12) || __clang_major__ >= 11
52
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
53
-#include <boost/asio/associated_allocator.hpp>
54
-#include <boost/asio/impl/compose.hpp>
55
-#include <boost/asio/impl/executor.hpp>
56
-#include <boost/asio/io_context.hpp>
57
-#include <boost/asio/strand.hpp>
58
-#include <boost/beast/core/async_base.hpp>
59
-#pragma clang diagnostic pop
60
-#endif  // DEPRECATED_ALLOCATOR_VOID && __clang__
61
+#endif
62
+
63
+#cmakedefine DISABLE_CLANG_C11_EXTENTIONS
64
+#if !__has_feature(c_atomic) && defined(DISABLE_CLANG_C11_EXTENTIONS)
65
+#pragma clang diagnostic ignored "-Wc11-extensions"
66
+#endif  // !__has_feature(c_atomic) && defined(DISABLE_CLANG_C11_EXTENTIONS)
67
+
68
+#endif  // __clang__
69
+
70
+#ifdef _MSC_VER
71
+
72
+#pragma warning(disable : 4459)
73
+#pragma warning(disable : 4646)
74
+#pragma warning(disable : 4702)
75
+
76
+#endif  // _MSC_VER
77
 
78
 #cmakedefine CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
79
 
(-)a/net/pichi/files/patch-src_net_adapter.cpp (-67 lines)
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:
(-)b/net/pichi/files/patch-src_net_http.cpp (+11 lines)
Added Link Here
1
--- src/net/http.cpp.orig	2022-12-12 17:06:47 UTC
2
+++ src/net/http.cpp
3
@@ -365,7 +365,7 @@ template <typename Stream> Endpoint HttpIngress<Stream
4
      * relative_path specified;
5
      *     - relative_path will be forwarded without any change.
6
      */
7
-    auto target = req.target().to_string();
8
+    auto target = string{cbegin(req.target()), cend(req.target())};
9
     assertFalse(target.empty(), PichiError::BAD_PROTO, "Empty path");
10
     if (target[0] != '/') {
11
       // absolute_path specified, so convert it to relative one.
(-)b/net/pichi/pkg-plist (-1 / +4 lines)
Lines 20-30 bin/pichi Link Here
20
%%DEVEL%%include/pichi/common/constants.hpp
20
%%DEVEL%%include/pichi/common/constants.hpp
21
%%DEVEL%%include/pichi/common/endpoint.hpp
21
%%DEVEL%%include/pichi/common/endpoint.hpp
22
%%DEVEL%%include/pichi/common/enumerations.hpp
22
%%DEVEL%%include/pichi/common/enumerations.hpp
23
%%DEVEL%%include/pichi/common/exception.hpp
23
%%DEVEL%%include/pichi/common/error.hpp
24
%%DEVEL%%include/pichi/common/literals.hpp
24
%%DEVEL%%include/pichi/common/literals.hpp
25
%%DEVEL%%include/pichi/common/uri.hpp
25
%%DEVEL%%include/pichi/common/uri.hpp
26
%%DEVEL%%include/pichi/crypto/aead.hpp
26
%%DEVEL%%include/pichi/crypto/aead.hpp
27
%%DEVEL%%include/pichi/crypto/base64.hpp
27
%%DEVEL%%include/pichi/crypto/base64.hpp
28
%%DEVEL%%include/pichi/crypto/brotli.hpp
29
%%DEVEL%%include/pichi/crypto/fingerprint.hpp
28
%%DEVEL%%include/pichi/crypto/hash.hpp
30
%%DEVEL%%include/pichi/crypto/hash.hpp
29
%%DEVEL%%include/pichi/crypto/key.hpp
31
%%DEVEL%%include/pichi/crypto/key.hpp
30
%%DEVEL%%include/pichi/crypto/method.hpp
32
%%DEVEL%%include/pichi/crypto/method.hpp
Lines 38-43 bin/pichi Link Here
38
%%DEVEL%%include/pichi/net/spawn.hpp
40
%%DEVEL%%include/pichi/net/spawn.hpp
39
%%DEVEL%%include/pichi/net/ssaead.hpp
41
%%DEVEL%%include/pichi/net/ssaead.hpp
40
%%DEVEL%%include/pichi/net/ssstream.hpp
42
%%DEVEL%%include/pichi/net/ssstream.hpp
43
%%DEVEL%%include/pichi/net/transparent.hpp
41
%%DEVEL%%include/pichi/net/trojan.hpp
44
%%DEVEL%%include/pichi/net/trojan.hpp
42
%%DEVEL%%include/pichi/net/tunnel.hpp
45
%%DEVEL%%include/pichi/net/tunnel.hpp
43
%%DEVEL%%include/pichi/stream/test.hpp
46
%%DEVEL%%include/pichi/stream/test.hpp

Return to bug 270934