0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00
Commit Graph

1801 Commits

Author SHA1 Message Date
Lev Stipakov
8ae2a3f7cf Integrate Google Test framework
Implemented sample test for LogInfo class.

OVPN3-27
2017-09-27 16:16:18 +08:00
Lev Stipakov
68ae101f42 Add swig build to jenkins pipeline
OVPN3-44

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
d496311ade ovpncli.hpp: inline LogInfo constructor for clarity
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
Lev Stipakov
96e0d89454 Revert "Merged in OVPN3-21-prepend-log-record-with-unique- (pull request #7)"
This reverts commit 62423c91cb, reversing
changes made to f26b08b6ef.
2017-09-27 16:16:18 +08:00
Lev Stipakov
7db95ccde6 Make build fail on compilation errors
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
860129a9b6 TunBuilderCapture: make (to|from)_json methods public
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
2486494bbe random: added helper class Rand2 containing a crypto and non-crypto RNG
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
04175c2b84 appversion.hpp: Stringize VERSION -> MY_VERSION
Default to "0.1.0" if VERSION is undefined.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
81cb887f67 build script: added DPROF=1 flag
When DPROF=1 and PROF is specified, build with
the debugging variant of the vars file.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
a3dd47fb4c timestr.hpp: moved milliseconds_since_epoch() to time/epoch.hpp
Also added nanoseconds_since_epoch() function

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
59b9492408 sslchoose.hpp: added SSL_LIB_NAME
In sslchoose.hpp, define SSL_LIB_NAME to be the name
(as a text string) of the selected SSL library.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
8fcb797174 ProtoContext::KeyContext::raw_recv() : fix state transition
In ProtoContext::KeyContext::raw_recv() when state == C_WAIT_RESET,
Antonio noticed that the send_reset() is likely superfluous.

proto.cpp test seems to confirm.

Comment it out for now.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
e49e993b3c ProtoContext: comment edit
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
1d941aa7bd VPNServerNetblock::Netblock refactor
In VPNServerNetblock::Netblock, break out IP::Range clients
and IP::Addr bcast into a separate derived class ClientNetblock,
which provides a more minimalisic Netblock for use cases that
don't need to manage client VPN IP address pools.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
7190495421 Server-side renamings to break up long class names using namespaces.
* renamed ManClientInstanceSend to ManClientInstance::Send
* renamed ManClientInstanceRecv to ManClientInstance::Recv
* renamed ManClientInstanceFactory to ManClientInstance::Factory
* renamed TransportClientInstanceSend to TransportClientInstance::Send
* renamed TransportClientInstanceRecv to TransportClientInstance::Recv
* renamed TransportClientInstanceFactory to TransportClientInstance::Factory
* renamed TunClientInstanceRecv to TunClientInstance::Recv
* renamed TunClientInstanceSend to TunClientInstance::Send
* renamed TunClientInstanceFactory to TunClientInstance::Factory

Other related refactorings/removals:

Changes to ManClientInstance::Send:

* Added pre_stop() method.
* Renamed set_acl_id() to set_acl_index().

Changes to ManClientInstance::Recv:

* In push_reply(), removed routes and initial_fwmark parameters.
* Removed set_fwmark() method.
* Added tun_native_handle() method to return the tun socket
  file descriptor and peer_id of a client instance.

Changes to ServerProto:

* Added C++11 override attribute to overridden virtual methods

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
3f74ec1466 Listen::List: minor changes
* Use C++11 range-based iterators.
* Use std::string rather than std::ostringstream
  for string formatting.
* Added to_string() method.
* Added local_addr() method.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
79c789b8c8 RandomAPI: comment edit
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
5b5af36775 Added SSLConst::SERVER_TO_SERVER flag
SSLConst::SERVER_TO_SERVER allows X509 certificates to be
used in a meshed toplology, where a server certificate can
be used for either the client or server side of an SSL
connection.

Currently only implemented for OpenSSL.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
fe00df455e OpenSSLContext::Config::set_rng: call assert_crypto()
This isn't strictly necessary because OpenSSL uses a
hardcoded RNG, but is added for consistency with other
SSL libraries.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
3ae0076274 In sslchoose.hpp, move OPENVPN_LOG_SSL macro to new file ssllog.hpp
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
1502cf6946 URL::Parse: made is_valid_uri_char() standalone and moved to validate_uri.hpp
In validate_uri.hpp, added these new methods:

* HTTP::is_valid_uri_char()
* HTTP::validate_uri()

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
2dcb18993c Added HTTP::Status::SwitchingProtocols constant
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
2f57024e8c HTTP::HeaderList: added get_value_trim_lower() method
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
bee94d2b4c HTTP::HeaderList: get_value() and get_value_trim() should return std::string instead of const std::string
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
5debab100d Frame::Context: #define OPENVPN_NO_IO to allow building without i/o layer
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
faf8f8fd51 StaticKey: added parse_from_base64() method
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
d11f250e76 HashString: added final_base64() method
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
c373bf87f2 CompressContext: use C++11 member initialization and remove explicit attribute on constructor
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
bd75cd787b RCPtr: added operator==() and operator!=() methods
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
7be33c5980 PThreadBarrier: fixed incorrect comment
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
6f5f77bc10 Link: use move semantics
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
17a5d89c9f inotify.hpp: no longer used
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
8ce39fc991 added render_hex() and render_hex_sep() methods that accept void* data
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
ddc8e8a434 Function: use std::forward
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
76ee5875a9 write_binary_atomic(): added tmpdir (temporary directory) parameter
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
f366d55105 base64: encode() now accepts void* data
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
462fe90807 BufferType: added read(), write(), and prepend() variants that accept void* data
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
9ad1be45ec IP::RouteType: added host_bits() method
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
3ebc8c7188 IPv[46]::Addr::to_sockaddr() now accepts optional port number
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
ce0977b2ea Support Cityhash.
When running build script, add CITY=1 to build with Cityhash library.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
fdbb0b96b1 IP::Addr: added validate_prefix_len()
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
25146d8539 IP::Addr::from_ipv[4|6](): use move semantics
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
Samuli Seppänen
a264f99339 Merge pull request #20 from OpenVPN/fix_travis_ci_coverity
travis: don't mess up the SSL libs for wget/curl
2017-09-27 09:49:36 +03:00
Antonio Quartulli
966e212536 travis: don't mess up the SSL libs for wget/curl
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-26 17:31:08 +08:00
Samuli Seppänen
2b8f09d9a2 Merge pull request #19 from OpenVPN/antonio/travis-ci-to-coverity
travis.yml: send build to Coverity SCAN when building master
2017-09-26 11:31:43 +03:00
Antonio Quartulli
127cbb0645 travis.yml: send build to Coverity SCAN when building master
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-25 22:40:36 +08:00
Samuli Seppänen
2bca49be9a Merge pull request #15 from OpenVPN/antonio/travis-ci
add basic support for Travis CI
2017-09-25 14:42:44 +03:00
Antonio Quartulli
a5ce566285 add basic support for Travis CI
Add a .travis.yml file with related scripts in order to
have a special branch built by travis-ci after each push.

At the moment travis-ci has been configured to build for
linux and macos using gcc-5 and clang-5, with both mbedtls
and openssl.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-21 16:54:29 +08:00
Antonio Quartulli
f9b14e9122 macOS: add basic logging support
OVPN3-16

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-08-17 18:12:23 +08:00
Antonio Quartulli
2b9188d286 Remotelist: pass meaningful port value to resolve::async_resolve()
OVPN3-13

Passing a static empty string as port to async_resolve() was
systematically triggering an exception when std::stoi() was
trying to parse it. On top of that, the port_ member of the
Preresolve object would not be instantiated with the right port value.

Fix it by passing the parsed port value coming from the config as
argument.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-08-17 17:29:06 +08:00