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

39 Commits

Author SHA1 Message Date
David Sommerseth
dde1574596
Reformatting source code to new coding style
This is the result after running 'clang-format -i' on all C++ files and
headers, with the defined formatting rules in .clang-format.

Only the openvpn/common/unicode-impl.hpp has been excluded, as that is
mostly a copy of an external project.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-01-18 19:24:15 +01:00
David Sommerseth
4996c38ed4
Merge lastest changes from Core v3.7.2 2022-12-14 17:34:29 +01:00
Frank Lichtenheld
5c5d115619 Fix some "variable set but not used" errors with clang 15
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-10-24 13:52:28 +02:00
David Sommerseth
8c94a8f774
copyright: Update to 2022
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-29 12:00:26 +02:00
Heiko Hund
7f103450f9
respect --http-proxy auth-method
Do not try other auth methods, if a specific method was given
as a third parameter to the --http-proxy config option.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:40:08 +02:00
James Yonan
3555b12a16
push-continuation: added new server-side fragmentor
Includes new unit test for both client and
server-side push-continuation code.

Signed-off-by: James Yonan <james@openvpn.net>
2020-08-19 18:53:00 +02:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
Lev Stipakov
8bf5c163d6
Improve profile error handling
Introduce new

 - ERR_PROFILE_FILE_IS_BINARY
 - ERR_PROFILE_OPTION

error codes.

Also use "ERR_PROFILE_FILE_TOO_LARGE"
when generic was erronrously used.

Fixes OVPN3-523.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-24 11:52:56 +02:00
Antonio Quartulli
3166957e2e
add error codes for better error management at profile parsing time
Prefix error messages with a predefined string of the form:

ERR_PROFILE_xxxxx:

This way a user can parse the prefix and get a better understanding of
the error, without relying on the sole message.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2019-10-09 17:58:05 +02:00
James Yonan
cadb712ea9
ProfileMerge: added "static-key" to is_fileref_directive()
Signed-off-by: James Yonan <james@openvpn.net>
2019-05-16 14:50:06 +02:00
Antonio Quartulli
60fcf374fb
tls-crypt-v2: implement WKc appending/unwrapping logic
The client reads the WKc from the key file and appends it to
the HARD_RESET_CLIENT_V3 packet when starting a connection.

The server reads the WKc from the received HARD_RESET_CLIENT_V3 packet,
decrypts and authenticates it (it is encrypted and signed with the
server keys upon generation) and finally extracts the client key.

The client key is then used to initialize the server tls-crypt.
At this point every packet is treated as a standard tls-crypt framed
message (HARD_RESET_CLIENT_V3 included).

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-12-06 09:19:22 +10:00
David Sommerseth
16b10559f2 [OVPN3-140] Update company names in copyrights
OpenVPN Technologies, Inc. change their name to OpenVPN Inc. during the
autumn of 2017.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
David Sommerseth
6caca2c313 [OVPN3-140] Relicense back to AGPLv3
This is essentially a revert of commit 04b2a3c9b7 and commit
ef42e59e05.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
Antonio Quartulli
74c5f4f38f [OVPN3-5] tls-crypt: introduce tls-crypt support
backported from OpenVPN 2.4.x

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
b2cd82a5bf copyright: updated to 2017.
Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 13:11:09 -06:00
James Yonan
9c0397ebd3 Added Relay capability, a kind of proxy function similar
to HTTP CONNECT but implemented over the OpenVPN protocol.

1. Client connects to relay server as if it were connecting
   to an ordinary OpenVPN server.

2. Client authenticates to relay server using its client
   certificate.

3. Client sends a PUSH_REQUEST method to relay server which
   then replies with a RELAY message instead of PUSH_REPLY.

4. On receiving the RELAY message, the client attempts to
   reconnect using the existing transport socket.  The
   server will proxy this new connection (at the transport
   layer) to a second server (chosen by the relay server)
   that is the target of proxy.

5. The client must establish and authenticate a new session
   from scratch with the target server, only reusing the
   transport layer socket from the original connection to
   the relay server.

6. The relay acts as a man-in-the-middle only at the
   transport layer (like most proxies), i.e. it forwards
   the encrypted session between client and target server
   without decrypting or having the capability to decrypt
   the session.

7. The client is designed to protect against potentially
   untrusted or malicious relays:

   (a) The client never transmits the target server
       username/password credentials to the relay server.

   (b) The relay forwards the encrypted OpenVPN session
       between client and target server without having
       access to the session keys.

   (c) The client configuration has a special directive
       for relay server CA (<relay-extra-ca>) and relay
       server tls-auth key (<relay-tls-auth>) to allow
       for separation of TLS/crypto configuration between
       relay and target servers.

   (d) The client will reject any PUSH_REPLY messages
       from the relay itself to prevent the relay from
       trying to establish a tunnel directly with the
       client.

Example configuring a client for relay:

  # remote addresses point to the relay server
  remote ... 1194 udp
  remote ... 443 tcp

  # include all other directives for connecting
  # to the target server

  # enable relay mode
  relay-mode

  # constrain the relay server's cert type
  relay-ns-cert-type server

  # include extra CAs that validate the relay
  # server cert (optional).
  <relay-extra-ca>
  -----BEGIN CERTIFICATE-----
  . . .
  -----END CERTIFICATE-----
  </relay-extra-ca>

  # specify the TLS auth key for the relay server
  relay-key-direction 1
  <relay-tls-auth>
  -----BEGIN OpenVPN Static key V1-----
  . . .
  -----END OpenVPN Static key V1-----
  </relay-tls-auth>
2017-03-18 12:24:54 -06:00
Samuli Seppänen
04b2a3c9b7 Switch from AGPLv3 to GPLv3
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
2017-03-16 14:43:55 +02:00
James Yonan
971abda88f copyright : updated to 2016 2016-09-03 23:29:23 -06:00
James Yonan
211af3a91b string : rename methods for consistency with in-place/copy
variants of other string methods:

* rename add_trailing() -> add_trailing_copy()
* rename add_trailing_in_place() -> add_trailing()
2016-03-28 09:42:13 -06:00
James Yonan
ba91532554 In merge.hpp, detect multiline breakout attempt. 2015-09-18 21:25:40 -07:00
James Yonan
35ac9f6229 Renamed types.hpp to size.hpp since it now only defines
size_t and ssize_t.
2015-05-17 13:27:34 -06:00
James Yonan
cc8af0e641 Added ProfileMergeFromString::merge() method. 2015-04-18 23:52:19 -06:00
James Yonan
8f4b17ce6a Add extension parameter to ProfileMerge constructor to allow
parsing of files with non-ovpn extensions.
2015-02-10 15:48:08 -07:00
James Yonan
d4af03c205 Extended follow_references parameter of ProfileMerge class to allow
for full reference following (e.g. cert ssl/serv.crt) as is helpful
in server-side environments.
2015-01-19 14:30:37 -07:00
James Yonan
c2c7292a70 Updated copyright to 2015. 2015-01-06 12:56:21 -07:00
James Yonan
2c6d972ad6 Added AGPL copyright/licensing language. 2014-07-20 21:22:06 -06:00
James Yonan
c77af1e85a Core: added CRL support (crl-verify directive) to PolarSSL module. 2014-04-22 01:55:05 -06:00
James Yonan
6fcceb6809 Core: fixed typo in merge.hpp where "auto-nct" was incorrectly
given as "auth-nct".
2014-01-08 21:05:24 -07:00
James Yonan
baca5e05d5 Core proxy changes:
Added support for "http-proxy" and "http-proxy-option" directives
in the main section of the config file, outside of <connection>
blocks.

Added <http-proxy-user-pass> multiline directive for inlining
proxy creds:

  <http-proxy-user-pass>
  user
  pass
  </http-proxy-user-pass>

Merge class now knows how to expand creds file inline.
For example,

  http-proxy ntlm.yonan.net 3128 auth.txt

is converted to:

  http-proxy ntlm.yonan.net 3128 auto
  <http-proxy-user-pass>
  user
  pass
  </http-proxy-user-pass>
2013-12-30 16:17:22 -07:00
James Yonan
ec084a0c71 Profile merge code now can merge external auth-user-pass cred files. 2013-12-22 17:06:23 -07:00
James Yonan
6c0be1e1c0 iOS: 1.0.1 build 55
Android: 1.1.9 build 31

* Reverted key-direction back to a default of 1.

* Raise fatal error if "fragment" option is used.

* Made TunBuilderCapture more useful as a base class for
  tun construction on various platforms.

* Added disableClientCert flag at ovpncli.hpp API.

* Updated help FAQ with more details on how to
  properly set key-direction, and notes about
  possible network disconnect during voice calls.
2013-01-24 13:34:17 +00:00
James Yonan
4d9a751af2 Added head comments to all source files.
Minor reorganization of unicode code.
2012-11-23 06:18:43 +00:00
James Yonan
31d87f09a4 Extend config file parser to recognize end-of-line comments
that start with # or ;

To pass these chars as part of an argument, make sure to quote
them.
2012-11-14 03:25:59 +00:00
James Yonan
32a117242e More profile validation. 2012-11-14 02:35:50 +00:00
James Yonan
df51e2bfc3 Minor SplitLines changes. 2012-11-12 02:33:20 +00:00
James Yonan
5a5a18942a Added parser size validation constants in
openvpn/client/cliconstants.hpp
2012-11-12 01:52:03 +00:00
James Yonan
4e6117a111 OpenVPN 1.0 Beta 25 (iOS)
* Added support for import of non-unified profiles via iTunes.

* Added Google DNS Fallback preference.
2012-11-07 22:03:10 +00:00
James Yonan
3ca3a857bd Initial HTTP proxy implementation in core, with support for
non-authenticated proxies and Basic Auth.

Includes new PROXY_ERROR and PROXY_NEED_CREDS events.

Still to do: Digest and NTLM auth.
2012-10-24 06:38:20 +00:00
James Yonan
cded2ca49e Android 1.1.1 build 9
* Fix attempt for java.lang.NullPointerException in
  net.openvpn.openvpn.OpenVPNService.onStartCommand(OpenVPNService.java:838)

* Allow non-unified profiles (i.e. profiles containing directives that
  reference other files) to be imported from SD card, as long
  as all referenced files are present in the same directory on the
  SD card as the profile.

* Relaxed parsing of "remote" directive to allow the port and/or
  protocol parameters to be omitted.  The port defaults to 1194
  and the protocol to UDP.  Either defaults can be changed with
  the "port" or "proto" directive.

* Fixed issue where profile parser was choking on files containing
  Windows-style line-endings.
2012-10-18 12:24:14 +00:00