1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-10 03:30:39 +03:00
Commit Graph

872 Commits

Author SHA1 Message Date
Davide Beatrici
a8c6a0c1b3 Cedar/Proto: rename "ProtoNewSession()" to "ProtoSessionNew()" and "ProtoDeleteSession()" to "ProtoSessionDelete()"
For consistency.

Also, the "proto" argument is now marked as const.
2020-08-06 02:41:13 +02:00
Davide Beatrici
ac1b045634 Cedar/Proto.c: fix session deletion not being triggered in certain cases
ProtoHandleDatagrams() takes care of deleting a session if marked as halted.
However, the check is performed when a packet for that session is received; that never happens if the remote host doesn't send at least a packet.

This commit fixes the issue by moving the check into the loop that iterates through all sessions.
2020-08-05 01:25:03 +02:00
dependabot[bot]
10e292b196
Bump elliptic in /src/bin/hamcore/wwwroot/admin/default
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.1 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.4.1...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-30 18:44:29 +00:00
Davide Beatrici
e8793a0098
Merge PR #1187: Find OpenSSL and zlib on Windows like we do on UNIX, use vcpkg on Azure Pipelines, remove Windows build on AppVeyor 2020-07-28 20:13:39 +02:00
Davide Beatrici
6b3ac84ba2 Cedar: remove old commands and unused variables 2020-07-28 00:57:37 +02:00
Davide Beatrici
18ad35ebfe Cedar/Admin: use Proto in StGetOpenVpnSstpConfig() and StSetOpenVpnSstpConfig()
For now Server Manager still uses the two RPC methods.
2020-07-28 00:57:36 +02:00
Davide Beatrici
b853140626 Cedar: use Proto API for protocol options 2020-07-28 00:57:36 +02:00
Davide Beatrici
5209b310e3 Cedar/Command: add ProtoOptionsGet and ProtoOptionsSet commands
ProtoOptionsGet command - Lists the options for the specified protocol
Help for command "ProtoOptionsGet"

Purpose:
  Lists the options for the specified protocol

Description:
  This command can be used to retrieve the options for a specific protocol.
  Detailed info (e.g. value type) will be shown.
  You can change an option's value with the ProtoOptionsSet command.

Usage:
  ProtoOptionsGet [protocol]

Parameters:
  protocol - Protocol name.

ProtoOptionsSet command - Sets an option's value for the specified protocol
Help for command "ProtoOptionsSet"

Purpose:
  Sets an option's value for the specified protocol

Description:
  This command can be used to change an option's value for a specific protocol.
  You can retrieve the options using the ProtoOptionsGet command.
  To execute this command, you must have VPN Server administrator privileges.

Usage:
  ProtoOptionsSet [protocol] [/NAME:option_name] [/VALUE:string/true/false]

Parameters:
  protocol - Protocol name.
  /NAME    - Option name.
  /VALUE   - Option value. Make sure to write a value that is accepted by the specified protocol!
2020-07-28 00:57:36 +02:00
Davide Beatrici
3a275d7257 Cedar/Admin: implement RPC methods to get/set Proto options 2020-07-28 00:57:36 +02:00
Davide Beatrici
aa65327e73 Mayaqua/Pack: add PackGetStrSize(), for strings with non-constant length 2020-07-28 00:57:36 +02:00
Davide Beatrici
b352aa4cc3 Cedar/Server: load and save Proto settings
Snippet from the server configuration:

declare root
{
...
	declare ServerConfiguration
	{
	...
		declare Proto
		{
			declare OpenVPN
			{
				string DefaultClientOption dev-type$20tun,link-mtu$201500,tun-mtu$201500,cipher$20AES-128-CBC,auth$20SHA1,keysize$20128,key-method$202,tls-client
				bool Enabled true
				bool Obfuscation false
				string ObfuscationMask $
				bool PushDummyIPv4AddressOnL2Mode true
			}
			declare SSTP
			{
				bool Enabled true
			}
		}
	...
	}
...
}
2020-07-28 00:57:36 +02:00
Davide Beatrici
6d85fffdb5 Cedar: introduce options API in Proto
PROTO_OPTION is a structure that describes an option (who would've guessed?).

It's designed in a way that allows it to occupy as low memory as possible, while providing great flexibility.

The idea is similar to the one implemented in LIST for trivial types, with the difference that PROTO_OPTION doesn't require casting due to the use of union.
2020-07-28 00:57:36 +02:00
Davide Beatrici
8685fe0da1 Cedar/Proto: introduce PROTO_CONTAINER, to store data for each implementation
ProtoImplDetect() is renamed to ProtoDetect(), because it now returns a pointer to a PROTO_CONTAINER (if successful).
2020-07-28 00:57:36 +02:00
Davide Beatrici
cd850c07ae Cedar: improve constness of PROTO_IMPL functions, move Name() at the top 2020-07-28 00:57:36 +02:00
Davide Beatrici
60410accce Remove Windows libraries and zlib submodule from the repository 2020-07-27 21:35:54 +02:00
Davide Beatrici
352ed759b2 CMake: find OpenSSL and zlib on Windows like we do on UNIX
This allows the project to be built with the support of vcpkg.
2020-07-27 21:32:50 +02:00
Davide Beatrici
4b9c33cd30 Cedar/SW.c: disable "vpninstall" and "vpnweb" tasks
The reason why we don't build these two targets is that they're not used.

More specifically: they require proper configuration to work correctly, which is currently missing.

While vpninstall may be worth salvaging, vpnweb is definitely a relict of the past because it relies on ActiveX.
2020-07-27 20:59:40 +02:00
Davide Beatrici
78dad1d568 Mayaqua/Microsoft.h: rename "driver_installer.exe" to "vpndrvinst.exe"
vpndrvinst is the name of the target and thus the default output name, let's use it.

`vpndrvinst.exe" also sounds less fishy than "driver_installer.exe"...
2020-07-27 20:59:40 +02:00
Davide Beatrici
6a472d827a Mayaqua: remove all references to binaries with "_x64" and "_ia64" suffix
See the previous commit's message for details.
2020-07-27 20:59:40 +02:00
Davide Beatrici
a3eb115b0a Cedar: remove all references to binaries with "_x64" and "_ia64" suffix
BuildUtil compiles the project as 32 bit and 64 bit, before building the installer package.

64 bit binaries have the "_x64" suffix and are added to the package alongside the 32 bit ones (that have no suffix).

The CMake project compiles the binaries for a single architecture and they have no suffix.

We decided that providing two separate installers is the best solution.

As for the binaries with the "_ia64" suffix: they never existed during the this repository's lifespan.
2020-07-27 20:59:40 +02:00
Davide Beatrici
24d64222ea Cedar/SW.c: load "vpnsetup.exe" directly instead of expecting it to be in "hamcore.se2"
The MSBuild project built the binary into "src/bin/hamcore", causing it to be added to "hamcore.se2".

As hinted by the name of the file ("vpnsetup_nosign.exe"), it is not signed by BuildUtil, possibly to save time (the setup package is signed).

The CMake project builds the binary in the same directory as the other ones, allowing the setup to install them without the need to build a package.
2020-07-27 20:59:40 +02:00
Davide Beatrici
cc61c90372 Cedar/SW.c: remove "install_src.dat" file check
Previously, the file needed to be present in order for the setup to work.

This commit removes the requirement so that the setup can be ran from the build directory without the need to copy the file (which is now removed from the repository).
2020-07-27 20:59:40 +02:00
Davide Beatrici
35200a29ea CMake: build vpnsetup 2020-07-27 20:59:40 +02:00
Davide Beatrici
c084ce30f9 CMake: build vpndrvinst 2020-07-27 20:59:40 +02:00
Davide Beatrici
755e09e5c1 Don't include OpenSSL headers in vpndrvinst.c
The inclusion of the headers is probably a very old leftover, from when OpenSSL was not encapsulated into Mayaqua yet.

In fact, there was a "HAM_C" (defined in vpndrvinst.c) definition check in Mayaqua/Encrypt.h preventing the redefinition of OpenSSL types.
2020-07-27 20:59:40 +02:00
Daiyuu Nobori
588d7539f4 vpntest.c: add "setupapi" command to test SetupAPI (Windows only)
Co-authored-by: Davide Beatrici <git@davidebeatrici.dev>
2020-07-27 05:31:02 +02:00
Davide Beatrici
28d4a113dc CMake: add manifest for all targets that have it in the MSBuild project 2020-07-25 23:13:45 +02:00
Davide Beatrici
3732447571 CMake: specify "WIN32" for targets that have WinMain()
When "VPN_EXE" is defined, Mayaqua.h defines WinMain(), which handles arguments in a special way.

This commit passes "WIN32" to add_executable(), so that WinMain() is used as entry point instead of main().

The use of main() instead of WinMain() was causing service mode not to work due to the "/service" argument being discarded.
2020-07-25 23:13:38 +02:00
Davide Beatrici
369a8850c4 CMake: don't hardcode build directories
Our CMake project used to forcefully create and use two different build directories: "build" and "tmp".

This commit changes the behavior so that only the build directory CMake is ran in is used.

The "configure" script now runs CMake in "build" by default, instead of "tmp".
2020-07-20 18:31:41 +02:00
Daiyuu Nobori
844dcdb0af Remove all references to strtok() and wcstok(), implement and use alternatives
strtok() and wcstok() are considered unsafe functions.

A segmentation fault caused by the use of strtok() was recently reported.

Co-authored-by: Takuho NAKANO <takotakot@users.noreply.github.com>
2020-07-20 17:57:58 +02:00
dnobori
144392c587 Add Tls_Disable1_3
Add Tls_Disable1_3 like Tls_Disable1_2 etc.
This change is part of v4.34-9744-beta e3370fb62c31eb10d0d221e628161863358d4cc3 .
2020-07-19 12:25:47 +09:00
Davide Beatrici
869496be3e Cedar: handle SSTP through Proto 2020-07-17 02:00:30 +02:00
Davide Beatrici
d917b2ac73 Cedar/Proto.c: check whether IsPacketForMe() is available before calling it
The SSTP implementation doesn't provide packet identification, because it's not required: the protocol is identified by the HTTP header it sends to the server.
2020-07-17 01:59:41 +02:00
Davide Beatrici
96a2d5a124 src/Cedar: pass client hostname and cipher to Init() function in PROTO_IMPL
The SSTP implementation must be aware of the cipher in order to be able to report it to the server's internals (i.e. IPC).
2020-07-17 01:59:22 +02:00
Davide Beatrici
3090688506 Cedar/Proto.c: support secure sockets
This is required for SSTP, because the connection is established through TLS/SSL.
2020-07-12 03:16:02 +02:00
Davide Beatrici
19dbdf46be Cedar: move buffer limit handling from ProtoHandleConnection() to protocol implementation
This allows greater control, required by SSTP: the limit only applies to data packets.
2020-07-12 03:09:12 +02:00
Davide Beatrici
eb5150a002 Cedar: change ProtoHandleConnection() so that it supports direct protocol specification 2020-07-12 03:05:51 +02:00
Davide Beatrici
6869955acc Cedar: fix server crash in CleanupSession()
"ClientOption", as the name implies, is only used in a client context.

The issue was introduced in 235bd07e67. Before that, an unrelated check prevented UnixVLanSetState() from being called in a server context.
2020-07-11 00:32:07 +02:00
Davide Beatrici
45399d9797 Cedar: fix ProtoSetUdpPorts() call in SiLoadServerCfg()
I accidentally passed the wrong variable in 4514ba5e2f.
2020-07-03 01:31:19 +02:00
Ron Isaacson
40ed982079 Fix systemd unit file generation 2020-06-30 01:22:37 -04:00
Ron Isaacson
6fe678fe84 Fix wrapper script generation 2020-06-29 23:04:35 -04:00
Davide Beatrici
235bd07e67 Cedar: remove "NicDownOnDisconnect" option
SoftEther VPN originally created the NIC in the UP state and never changed it, even when the the client was not connected.

The behavior was changed in 59e1483dbf, which also added the NicDownOnDisconnect option

The option was disabled by default for backwards compatibility with scripts that don't check whether the NIC is down, but it's not ideal.

This commit forces the correct behavior and removes the commands "TUNDownOnDisconnectEnable", "TUNDownOnDisconnectDisable" and "TUNDownOnDisconnectGet".
2020-06-27 22:47:04 +02:00
Ilya Shipitsin
47d08b055e
Merge pull request #1114 from takotakot/disable_sslv3
Disable SSLv3
2020-06-18 11:21:59 +05:00
Davide Beatrici
485a5922eb
Merge PR #1146: Cedar/Server.c: load UDP ports from configuration file and apply them 2020-06-10 10:00:10 +02:00
Davide Beatrici
4514ba5e2f Cedar/Server.c: load UDP ports from configuration file and apply them
Unfortunately I realized only now that I didn't add the code in c4ec63fe32.
2020-06-10 09:42:23 +02:00
Takuho NAKANO
5ebdb394fc Disable sslv3 2020-06-09 13:59:57 +09:00
Tetsuo Sugiyama
d726719602
Fixed that NewDhcpOption did not handle DHCP options longer than 255 bytes correctly 2020-05-22 11:05:36 +09:00
Davide Beatrici
c4838006b1 Cedar/SM.c: move UDP ports setting outside of the OpenVPN/SSTP dialog
This commit moves the UDP ports setting right below the TCP listeners and uses the new RPC methods to get and set them.
2020-05-20 20:18:51 +02:00
Davide Beatrici
c52e49de2d Cedar/SM: replace SmStrToPortList() with StrToPortList()
The function only called StrToPortList(), thus it can safely be replaced with the upstream function.
2020-05-20 20:18:51 +02:00
Davide Beatrici
9e6476c7b2 Cedar/Command: Implement PortsUDPGet and PortsUDPSet commands
PortsUDPSet: This command can be used to specify a single or multiple UDP ports the server should listen on. "0" can be specified to disable the UDP listener.
Administrator privileges are required to execute the command.

PortsUDPGet: This command can be used to retrieve the UDP ports the server is listening on.

The two commands replace the functionality that was previously provided by OpenVpnEnable and OpenVpnGet, respectively.
2020-05-20 20:17:53 +02:00
Davide Beatrici
37f28b4119 Cedar/Command: add "limit_range" parameter to StrToPortList()
Originally, StrToPortList() returned NULL when it encountered a number equal to 0 or higher than 65535.

This commit adds a new parameter to the function called "limit_range":

- When its value is true, the function retains the original behavior.
- When its value is false, the function doesn't check whether the number is in the network port number range (1-65535).

The change is required because the command to set the UDP ports will allow to remove all ports by specifying "0" as the port number.
2020-05-20 20:17:40 +02:00
Davide Beatrici
f1cb86d979 Cedar/Admin: implement new RPC methods to get/set the UDP ports 2020-05-20 20:17:34 +02:00
Davide Beatrici
c4ec63fe32 Rename "OpenVPN_UdpPortList" to "PortsUDP", store ports in a LIST
Now that Proto supports UDP, the server can handle multiple protocols on each UDP port.

The UDP ports are specified by the "OpenVPN_UdpPortList" configuration setting, because:

- OpenVPN is currently the only UDP protocol supported by SoftEther VPN to allow a custom port number.
- Before Proto was introduced, a unified interface for the protocols didn't exist; each protocol implementation had to create its own listener.

In preparation for the upcoming WireGuard implementation, this commit renames "OpenVPN_UdpPortList" to "PortsUDP", which should clarify that the setting is global.

The change is reflected in the code. Also, the ports are now stored in a LIST rather than a string. The conversion between string and LIST only happens when loading/saving the configuration.

The default UDP ports are now the same as the TCP ones (443, 992, 1194, 5555).
2020-05-20 03:16:19 +02:00
Evengard
b77dd167ff Fixes from review of PPP-IPv6 stack 2020-05-19 17:25:04 +03:00
Ilya Shipitsin
1a8e1385cf
Merge pull request #1125 from Evengard/ppp-ipv6
IPv6 support for the PPP stack
2020-05-19 17:09:09 +05:00
Ilya Shipitsin
e3e35f5a4c
Merge pull request #1122 from benrubson/ban
Log client IP in failed accesses
2020-05-13 15:35:45 +05:00
Ben RUBSON
5e1c728f92
Update strtable_tw.stb 2020-05-12 22:08:59 +02:00
Ben RUBSON
eb9d6e77a4
Update strtable_ru.stb 2020-05-12 22:08:42 +02:00
Ben RUBSON
6e707f7550
Update strtable_pt_br.stb 2020-05-12 22:08:23 +02:00
Ben RUBSON
71b814060d
Update strtable_ko.stb 2020-05-12 22:08:05 +02:00
Ben RUBSON
8e1a377b82
Update strtable_ja.stb 2020-05-12 22:07:35 +02:00
Ben RUBSON
adf0f18b7a
Update strtable_cn.stb 2020-05-12 22:07:09 +02:00
Davide Beatrici
20bbe325fe Cedar/Proto.c: fix wrong NULL check in ProtoHandleDatagrams(), found by Coverity
*** CID 358434: Null pointer dereferences (REVERSE_INULL)
 /src/Cedar/Proto.c: 451 in ProtoHandleDatagrams()
 445   void ProtoHandleDatagrams(UDPLISTENER *listener, LIST *datagrams)
 446   {
 447       UINT i;
 448       HASH_LIST *sessions;
 449       PROTO *proto = listener->Param;
 450
 >>>   CID 358434: Null pointer dereferences (REVERSE_INULL)
 >>>   Null-checking "listener" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
 451       if (proto == NULL || listener == NULL || datagrams == NULL)
 452       {
 453           return;
 454       }
 455
 456       sessions = proto->Sessions;
2020-05-12 21:26:42 +02:00
Evengard
cbbac659a3 Fixing VS2015 quirks 2020-05-12 18:51:55 +03:00
Evengard
2cfe031398 Fixing most errors, the link on Windows is working and is stable 2020-05-12 18:10:06 +03:00
Evengard
a2a6502ab9 Numerous fixes. First working version. 2020-05-12 18:05:19 +03:00
Evengard
f2fee4d32c Preliminary implementation of IPv6CP and IPv6 for PPP (untested) 2020-05-12 18:05:18 +03:00
Evengard
f627b64264 Auto formatting with AStyle 2020-05-12 17:59:25 +03:00
Evengard
1d6a4d3ec8 Preliminary IPC IPv6 implementation (untested) 2020-05-12 17:59:24 +03:00
Ben RUBSON
3b7dd25b65
Log client IP in failed accesses 2020-05-11 23:10:40 +02:00
Ben RUBSON
3f16a7e704
Log client IP in failed accesses
to be able to feed tools such as Fail2Ban
2020-05-11 23:09:26 +02:00
Ben RUBSON
4e583e43f1
Increase Radius timeout
to make it 2FA friendly
2020-05-11 23:06:01 +02:00
Davide Beatrici
981b57ee28 Cedar/Server: set ports in Proto, remove OpenVPN UDP server leftovers
The setting's name is still "OpenVPN_UdpPortList".

We will change it as soon as there's another UDP protocol implemented in Proto.
2020-05-11 08:23:32 +02:00
Davide Beatrici
27f7d43ff7 Cedar/Proto_OpenVPN: remove UDP system, use the one provided by Proto
As a side effect, the DH parameter is now applied to the TCP server as well.

Previously, the default value was always used, ignoring the one from the configuration.
2020-05-11 08:23:29 +02:00
Davide Beatrici
a3aea00820 Cedar/Proto: implement UDP system
When a datagram is received, the matching session is looked up in a hash list; if it's not found, a new session is created.

This method allows to use a single UDP port for multiple protocols, as we do with TCP.

Also, each session has its own dedicated thread, used to process the received datagrams and generate the ones that are then sent through the UDP listener.

In addition to guaranteeing constant performance, separate threads also prevent a single one from blocking all sessions.
2020-05-11 08:22:44 +02:00
Davide Beatrici
0570f7d31c Mayaqua/Network: add StopUdpListener()
This allows to stop a UDP listener without deleting it.

It's especially useful when no datagrams should be received anymore, but there are other threads accessing the listener.
2020-05-11 07:50:55 +02:00
Davide Beatrici
667108319d Cedar: prepare Proto for UDP support
- An additional parameter is added to IsPacketForMe(), used to specify the protocol type (currently either TCP or UDP).
- SupportedModes() is dropped because it's now redundant.
- IsOk() and EstablishedSessions() are dropped because error checking should be handled by the implementation.
- ProtoImplDetect() now takes a buffer and its size rather than a SOCK, so that it can be used to detect UDP protocols.
- The OpenVPN toggle check is moved to ProtoImplDetect(), so that we don't have to duplicate it once UDP support is implemented.
2020-05-11 07:07:04 +02:00
Evengard
34dfc14549 Fixing errors discovered with Coverity. 2020-05-04 16:07:21 +03:00
Evengard
1fe863e866 Generate DHCP Client ID based on MAC all the time 2020-05-04 15:40:44 +03:00
Ilya Shipitsin
b41c17f45a
Merge pull request #1109 from Evengard/ppp-eap-tls
Implementation of EAP-TLS for PPP
2020-05-04 17:13:15 +05:00
Evengard
ca1c6a5f3f Fixing a use of unitialized variable as per CPPCHECK 2020-05-03 14:22:18 +03:00
Evengard
8fb456f6a6 Fixing a memory leak in SslCertVerifyCallback because of a duplicated callback 2020-05-03 05:36:01 +03:00
Evengard
132926ee09 Fixing alignment of struct on GCC, changing the method to server one 2020-05-03 05:17:23 +03:00
Evengard
8a856e4672 Codestyle fixes 2020-05-02 21:08:19 +03:00
Evengard
9180e065a0 Some weirdness fixes 2020-05-02 20:29:31 +03:00
Evengard
39becfe4ab Some hacks to make Android VPN Client Pro working 2020-05-02 20:25:01 +03:00
Evengard
723f38e72f Fixing Linux... 2020-05-02 19:52:47 +03:00
Evengard
a2b7cb0148 Added possibility to load CA certificates from chain_certs folder to allow verifying the client certificates against it. 2020-05-02 19:52:46 +03:00
Evengard
24bd2b3198 Fixing up some errors 2020-05-02 19:52:46 +03:00
Evengard
9f2a5cecf3 Preliminary (untested) EAP-TLS implementation 2020-05-02 19:52:46 +03:00
Evengard
a65c436e8f Writing skeleton for EAP-TLS implementation 2020-05-02 19:52:45 +03:00
Evengard
aa0ec4343c Fixing errors as per static analysis 2020-05-02 19:52:45 +03:00
Evengard
1bdd9a92bc Adding timeout propagation from user policy in PPP sessions (including L2TP and SSTP). 2020-05-02 19:52:45 +03:00
Davide Beatrici
942051d3a8 Cedar: various improvements to Proto
The PROTO structure is now used to identify the system as a whole, rather than a single protocol. It's stored and initialized in Server.

ProtoCompare(), ProtoAdd() and ProtoDetected() are renamed to make the difference between PROTO and PROTO_IMPL more clear.

ProtoGet() and ProtoNum() are removed because the related list can now be accessed directly by Server.
2020-05-01 07:14:38 +02:00
Ilya Shipitsin
039cd8edf0
Merge pull request #1107 from chipitsine/master
5.01.9674 release
2020-04-30 13:26:45 +05:00
Ilya Shipitsin
a902d3eed9 5.01.9674 release 2020-04-30 12:02:05 +05:00
dependabot[bot]
44f731f781
Bump jquery in /src/bin/hamcore/wwwroot/admin/default
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-30 06:12:25 +00:00
Evengard
f20e99f8e4 Treating empty IPCP requests as IPCP requests with IP-Address option zeroed out 2020-04-25 20:59:08 +03:00
Evengard
b9109211d3 ACKing an empty LCP options list 2020-04-25 15:29:57 +03:00
Davide Beatrici
9073452b09
Merge PR #1092: src/Cedar/Proto_OpenVPN.c: push "block-outside-dns" to clients 2020-04-20 03:25:43 +02:00
Ilya Shipitsin
70a7c4596d 5.01.9673 release 2020-04-18 00:47:47 +05:00
Daiyuu Nobori
033647c8ac Fix security issue: Fix the security of JSON-API. If the administrator password of the Virtual Hub is empty, JSON-API (which was added in 4.30 Build 9696 Beta) will not be able to access to the virtual hub with a empty password since this release. Because there are relatively many cases in which administrator password is empty for a virtual hub, being able to manage a virtual hub without a password using JSON-API was a security problem. In this release, this behavior has been changed so that JSON-API cannot be accessed in the Virtual Hub management mode until it is configured with non-empty password. 2020-04-06 00:44:14 +09:00
Davide Beatrici
b6ef9f88c9 src/Cedar/Proto_OpenVPN.c: push "block-outside-dns" to clients
From https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage:

--block-outside-dns

Block DNS servers on other network adapters to prevent DNS leaks.
This option prevents any application from accessing TCP or UDP port 53 except one inside the tunnel.
It uses Windows Filtering Platform (WFP) and works on Windows Vista or later.
This option is considered unknown on non-Windows platforms and unsupported on Windows XP, resulting in fatal error.
You may want to use --setenv opt or --ignore-unknown-option (not suitable for Windows XP) to ignore said error.
Note that pushing unknown options from server does not trigger fatal errors.
2020-04-04 08:37:19 +02:00
Ilya Shipitsin
c6f186bd73
Merge pull request #1084 from ffontaine/master
Only enable getifaddrs support when available
2020-04-03 17:45:19 +05:00
Ilya Shipitsin
84bd9abb30
Merge pull request #1072 from Evengard/ppp-ipv6
Rewriting the PPP stack
2020-04-02 20:29:51 +05:00
Georgy Komarov
4772a508dc
sam: fix using pointer to local variable that is out of scope 2020-03-27 07:28:43 +03:00
Georgy Komarov
1416a693e7
protocol: fix uninitialized variable
Value of server_cert is undefined if `b = PackGetBuf(p, "Cert");` was
failed.
2020-03-27 07:25:45 +03:00
Paul Menzel
be3e45a4bf hamcore: Remove trailing spaces from comments 2020-03-25 12:23:55 +01:00
Fabrice Fontaine
dcecd4c0d5 Only enable getifaddrs support when available
On uClibc, the ifaddrs.h support is optional. While the default
Buildroot uClibc configuration has it enabled, some external
toolchains may not. Therefore this patch detects that and adjusts
softether usage of ifaddrs accordingly.

Based on an initial patch from Bernd Kuhls.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/softether/0009-uclibc-ai-addrconfig.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-03-21 17:57:37 +01:00
Ilya Shipitsin
3b00d4c56b
Merge pull request #1081 from metalefty/describe_cmake_flags
Describe CMake options added by myself
2020-03-20 18:43:16 +05:00
Koichiro IWAO
e6b8e6eee3
replace SoftEther project related http links with https
Outside links such as http://www.openssl.org and http links appear in
source code are untouched.
2020-03-20 21:27:51 +09:00
Koichiro IWAO
78b0684dd4
Document additional CMake options
Some CMake options are added by myself (#1047 #1079). So I should
describe in document.
2020-03-20 21:24:51 +09:00
Koichiro IWAO
c222ef525b
Update build requirements on Unix 2020-03-18 18:28:33 +09:00
Ilya Shipitsin
c3d56c2201
Merge pull request #1079 from metalefty/skip_cpu_features
allow to SKIP_CPU_FEATURES explicitly, not only autodetect
2020-03-18 11:59:02 +05:00
Koichiro IWAO
f34d3c80b1
allow to SKIP_CPU_FEATURES explicitly, not only autodetect
Formerly, SKIP_CPU_FEATURES is automatically detected by system
processor. However, "^(armv7l|aarch64|s390x)$" does not cover all
processors that cpu_features should be skipped.

"armv6", "armv7", "mips", "mips64" on FreeBSD are examples [1]
that cpu_features is not correctly skipped.

This change intends to build SoftEther without any modifications on
CMakeLists.txt on such processors.

    cmake . -DSKIP_CPU_FEATURES=1

[1] https://www.freebsd.org/platforms/
2020-03-16 18:50:55 +09:00
dependabot[bot]
c635cdd614
Bump acorn from 6.1.1 to 6.4.1 in /src/bin/hamcore/wwwroot/admin/default
Bumps [acorn](https://github.com/acornjs/acorn) from 6.1.1 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.1.1...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-15 22:06:23 +00:00
Evengard
fa9e9d15a5 Removing unrelated changes as per review 2020-02-06 10:52:34 +03:00
Evengard
60e85afd1f
Apply reviewed code style
Co-Authored-By: Davide Beatrici <davidebeatrici@gmail.com>
2020-02-06 10:49:09 +03:00
Evengard
a6970e3e61 Merge branch 'master' into ppp-ipv6 2020-02-05 00:23:03 +03:00
Ilya Shipitsin
eeec9a82f6
Merge pull request #1062 from dnobori/200101_impr_url_log_spacing
Merge pull request #1062: Improvement: Add a space character between URL and other tokens in the packet log format.
2020-01-01 17:53:27 +05:00
Daiyuu Nobori
a49219db83 Merge branch 'master' of github.com:SoftEtherVPN/SoftEtherVPN into 200101_fix_securenat_ecn 2020-01-01 19:59:42 +09:00
Daiyuu Nobori
a4f87565ae Bugfix: Fix the SecureNAT connection problem with ignoring TCP ECN bit enabled packets 2020-01-01 17:51:38 +09:00
Ilya Shipitsin
9487bc8d47
Merge pull request #1060 from dnobori/200101_fix_imperfect_lock
Merge pull request #1060: src/Cedar/Hub.c: fix possible crash because of imperfect Virtual Hub FDB lock
2020-01-01 12:33:15 +05:00
Daiyuu Nobori
70564a8f52 Bugfix: Imperfect Virtual Hub FDB lock may cause process crush. 2020-01-01 15:52:47 +09:00
Daiyuu Nobori
17e7d65839 Improvement: Add a space character between URL and other tokens in the packet log format. 2020-01-01 11:00:51 +09:00
Daiyuu Nobori
e5d691977d Bugfix: OpenVPN Certificate Authentication may cause process crush. 2020-01-01 10:59:24 +09:00
Daiyuu Nobori
f083c59905 Bugfix: Imperfect Virtual Hub FDB lock may cause process crush. 2020-01-01 10:57:51 +09:00
FelipeL
6d3fef8da6 pt-br translation 2019-12-28 15:43:06 +05:00
Koichiro IWAO
c8479e3011
CMake: make db, log, pid directory customizable 2019-12-04 23:59:18 +09:00
Koichiro IWAO
b1aae5080d
put chain_certs in dbdir 2019-12-04 23:59:13 +09:00
Koichiro IWAO
a69c4980d5
log eraser, log enumerator should refer logdir 2019-12-04 23:59:11 +09:00
Koichiro IWAO
c64674479d
separte log directory and database(config) directory
@ was an alias for exedir. To separate log directory and
database(config) directory, @ is now an alias for logdir and $ is an
alias for dbdir.
2019-12-04 23:59:09 +09:00
Koichiro IWAO
01abdedc45
put PID files under PidDir 2019-12-04 23:59:07 +09:00
Koichiro IWAO
18c9b74ff0
implement Get{Db,Log,Pid}{,W} function
DbDir  : directory to store files such as vpn_server.config and backups etc
LogDir : directory to write logs (sub directories is created in this dir)
PidDir : directory to put PID files such as .ctl-* .pid-* .VPN-*
2019-12-04 23:59:01 +09:00
Ilya Shipitsin
3b6c4d02ac 5.01.9672 release 2019-11-24 20:47:23 +05:00
dnobori
1d2a58b172 Cedar: handle UDP acceleration and R-UDP versions 2019-11-23 04:38:27 +01:00
Davide Beatrici
6b08a451da Mayaqua: implement R-UDP version 2, powered by ChaCha20-Poly1305 2019-11-23 04:38:20 +01:00
Davide Beatrici
2ea5c2a7b0 Cedar: implement UDP acceleration version 2, powered by ChaCha20-Poly1305 2019-11-23 04:23:56 +01:00
dnobori
82a81a3ce6 Cedar: serve new web management interface 2019-11-23 04:23:56 +01:00
dnobori
9aaa9a7f15 Cedar: implement detailed protocol info 2019-11-23 04:23:56 +01:00
dnobori
ab57ef3f54 Mayaqua: add Windows Server 2019 to the supported operating systems list 2019-11-23 04:23:56 +01:00
dnobori
76ae935172 Cedar: various fixes 2019-11-23 04:23:51 +01:00
Daiyuu Nobori
76c330e74b Cedar: add "DisableIPsecAggressiveMode" option
Setting it to "true" mitigates CVE-2002-1623.
2019-11-18 06:16:49 +01:00
Davide Beatrici
4acd7ab98e
Merge PR #1022: Move generic proxy stuff from Cedar to Mayaqua 2019-11-01 09:35:18 +01:00
Donald Buczek
12cbf34302 Make install dir for unit files configurable
Currently the systemd service unit files are installed
into /lib/systemd/system if that directory exists. This
might not be optimal for every user, e.g. when the build
system is not the target system or when building as an
unprivileged user using CMAKE_INSTALL_PREFIX.

Make this configurable by adding a cached cmake variable
CMAKE_INSTALL_SYSTEMD_UNITDIR. Usage:

- install unit files into /lib/systemd/system if it exists (old
behavior)

    cmake

- don't install unit files

   cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=

- install into absolute path

   cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=/path

- install into path relative to ${CMAKE_INSTALL_PREFIX}

   cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=path
2019-10-30 11:33:08 +01:00
Davide Beatrici
63caa4b07f Protocol.c: adapt ClientConnectGetSocket() for new proxy functions
The function has been greatly improved, here are some of the changes:

- The required SESSION (c->Session) parameter is checked correctly: the function returns immediately in case it's NULL. Previously, the function didn't return in case the parameter was NULL; multiple checks were in place, but not in all instances where the parameter was dereferenced.
- The resolved IP address is cached with all proxy types.
- The "RestoreServerNameAndPort" variable is documented.
- The Debug() messages have been improved.
2019-10-30 01:39:11 +01:00
Davide Beatrici
3c21d982fc Wpc.c: adapt WpcSockConnectEx() for new proxy functions 2019-10-30 01:39:11 +01:00
Davide Beatrici
59dc26aa21 Protocol: add ProxyCodeToCedar()
This new function translates a proxy error code to a Cedar error code.
2019-10-30 01:39:11 +01:00
Davide Beatrici
b8f58a2f94 Move generic proxy stuff from Cedar to Mayaqua
This commit moves the generic (not related to our protocol) proxy stuff from Cedar to Mayaqua, in dedicated files.

The functions are refactored so that they all have the same arguments and follow the same logic.

Dedicated error codes are added, in order to indicate clearly why the function(s) failed.
2019-10-30 01:39:04 +01:00
Davide Beatrici
5d73cd878f Proto_OpenVPN.c: improve OvsProcessData(), fix out-of-bounds access found by Coverity
Coverity Scan detected an out-of-bounds access issue: OvsProcessData() checked whether the payload size was bigger than the size of the buffer, instead of checking whether the entire packet size (payload size + 2 bytes) was, resulting in an out-of-bounds access in case the payload size is bigger than 1998.

This commit also improves the variable names, the comments and adds two Debug() lines.
2019-10-27 09:01:56 +01:00