1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 16:25:01 +03:00
Commit Graph

487 Commits

Author SHA1 Message Date
6903f9b89f CMake: build targets with versioning info on Windows 2018-11-27 05:26:21 +01:00
8a58af86b1 Cedar: add new "UsernameHubSeparator" configuration option for the server, to specify a different character from '@' 2018-11-25 20:50:14 +01:00
03f80edfcd Cedar/Proto_OpenVPN.c: don't release data channel if it's not established, improve logic and debug messages 2018-11-19 21:30:42 +01:00
264760aaf5 Merge PR #808: OpenVPN: Add packet scrambling/obfuscation feature 2018-11-19 21:14:27 +01:00
e1bd84d7f3 CMake: set PDB output directory, don't set default build type 2018-11-18 04:18:42 +01:00
6a45921f41 OpenVPN: Add packet scrambling/obfuscation feature
This allows an OpenVPN client to bypass a firewall which is aware of the protocol and is able to block it.
The XOR mask set on the server has to be the same on the client, otherwise it will not be able to connect with certain obfuscation modes.
A special OpenVPN client built with the "XOR patch" is required in order to use this function, because it has never been merged in the official OpenVPN repository.

Two parameters are added to the server configuration: "OpenVPNObfuscationMethod" and "OpenVPNObfuscationMask".
Their value can be retrieved with "OpenVpnObfuscationGet" and set with "OpenVpnObfuscationEnable" in the VPN Command Line Management Utility.
2018-11-12 22:32:37 +01:00
304893c139 src/Cedar/Protocol, src/Cedar/Session: cleanup, remove unused functions, variables,
resolve possible null pointer dereference

found by cppcheck

[src/Cedar/Protocol.c:3138] -> [src/Cedar/Protocol.c:3071]: (warning) Either the condition 's!=NULL' is redundant or there is possible null pointer dereference: s.
[src/Cedar/Protocol.c:916]: (style) Variable 'save' is assigned a value that is never used.
[src/Cedar/Protocol.c:6242]: (style) Variable 'size' is assigned a value that is never used.
[src/Cedar/Protocol.c:778]: (style) Variable 'old_disable' is assigned a value that is never used.
[src/Cedar/Protocol.c:1021]: (style) Variable 'save' is assigned a value that is never used.
[src/Cedar/Protocol.c:3708]: (style) Variable 'is_vgc' is assigned a value that is never used.
[src/Cedar/Protocol.c:5785]: (style) Variable 's' is assigned a value that is never used.
[src/Cedar/Protocol.c:6164]: (style) The function 'SocksConnectEx' is never used.
[src/Cedar/Protocol.c:907]: (style) The function 'CompareNodeInfo' is never used.
[src/Cedar/Protocol.c:6968]: (style) The function 'ProxyConnect' is never used.
[src/Cedar/Protocol.c:3986]: (style) The function 'SecureDelete' is never used.
[src/Cedar/Protocol.c:4042]: (style) The function 'SecureEnum' is never used.
[src/Cedar/Protocol.c:4127]: (style) The function 'SecureWrite' is never used.
[src/Cedar/Protocol.c:6463]: (style) The function 'SocksConnect' is never used.
[src/Cedar/Protocol.c:7185]: (style) The function 'TcpConnectEx2' is never used.
[src/Cedar/Protocol.c:7206]: (style) The function 'TcpIpConnect' is never used.
2018-11-10 14:18:18 +05:00
a5f18087cd Merge PR #790: Add support for SOCKS5 proxy protocol 2018-11-07 01:30:56 +01:00
85ebba5e39 Cedar/Proto_PPP.c: push 192.0.0.8 instead of 1.0.0.1 as gateway IP address
1.0.0.1 is a real IP address, owned by CloudFlare and used for their DNS service.

This commit changes the IP address we push to 192.0.0.8, which is defined in RFC7600 as dummy IPv4 address.
2018-11-07 00:07:01 +01:00
ba930668ba Merge PR #796: Cedar/Proto_OpenVPN: add support for GCM ciphers 2018-11-04 01:01:10 +01:00
dcc684ea28 src/Cedar/Admin.c: remove reccuring check
found by PVS analyzer

src/Cedar/Admin.c	5583	err	V571 Recurring check. The 'if (no_include)' condition was already verified in line 5581.
2018-11-04 01:02:51 +05:00
bfe8ee8127 src/Cedar/Proto_IkePacket: remove unused functions, redundant assignments
found by cppcheck

[src/Cedar/Proto_IkePacket.c:958]: (style) The function 'IkeNewCertPayload' is never used.
[src/Cedar/Proto_IkePacket.c:942]: (style) The function 'IkeNewCertRequestPayload' is never used.
[src/Cedar/Proto_IkePacket.c:875]: (style) The function 'IkeNewNoticeErrorInvalidExchangeTypePayload' is never used.
[src/Cedar/Proto_IkePacket.c:2542]: (style) The function 'IkeNewSpi' is never used.
[src/Cedar/Proto_IkePacket.c:142]: (style) The function 'IkePhase1CryptIdToKeySize' is never used.
[src/Cedar/Proto_IkePacket.c:157]: (style) The function 'IkePhase2CryptIdToKeySize' is never used.
[src/Cedar/Proto_IkePacket.c:172]: (style) The function 'IkeStrToPhase1CryptId' is never used.
[src/Cedar/Proto_IkePacket.c:187]: (style) The function 'IkeStrToPhase1HashId' is never used.
[src/Cedar/Proto_IkePacket.c:196]: (style) The function 'IkeStrToPhase2CryptId' is never used.
[src/Cedar/Proto_IkePacket.c:211]: (style) The function 'IkeStrToPhase2HashId' is never used.
[src/Cedar/Proto_IkePacket.c:2168]: (style) Condition 'b==NULL' is always true
2018-11-04 00:13:51 +05:00
9afcc91ae1 Cedar/Proto_OpenVPN: add support for GCM ciphers 2018-11-03 16:14:56 +01:00
953989d344 Proto_OpenVPN.c: move encrypt and decrypt process into dedicated functions 2018-10-31 18:14:38 +01:00
53e0a2e5e2 Add support for SOCKS5 proxy protocol 2018-10-30 15:11:16 +01:00
c1f522c10e CMake: add support for Windows (Visual C++ 2017 toolset) 2018-10-24 21:25:57 +02:00
b72292edd1 Try to fix macOS build 2018-10-20 13:31:45 +02:00
3429e1bf31 CMake: build Cedar and Mayaqua as shared libraries, create "common" package 2018-10-20 13:12:49 +02:00
99a029c7c4 Merge PR #759: Protocol.c: fix crash with OpenVPN when the certificate's common name is empty 2018-10-18 22:24:37 +02:00
f061557aad Protocol.c: fix crash with OpenVPN when the certificate's common name is empty 2018-10-18 21:21:37 +02:00
63513259c0 src/Cedar/Logging.c: clean compiler warning
warning: zero-length gnu_printf format string [-Wformat-zero-length]
2018-10-17 15:31:36 +05:00
91c5d5feb8 Cedar/Bridge.c: fix NULL pointer dereference in GetEthDeviceHash() 2018-10-16 04:40:22 +02:00
8df347c093 Added OpenSSL 1.1.1 .lib files for Visual Studio 2008. 2018-10-09 20:30:03 +09:00
03d78693a3 Merge PR #735: Debug flag and test mode improvements 2018-10-08 21:00:44 +02:00
8abcf3d0a9 Debug flag and test mode improvements
1. ifdef DEBUG -> defined(_DEBUG) || defined(DEBUG)
In VC++ compilers, the macro is "_DEBUG", not "DEBUG".

2. If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak.
For normal debug we set memcheck = false.
Please set memcheck = true if you want to test the cause of memory leaks.
2018-10-08 04:50:46 +02:00
2d76507561 Next, change the project name "Ham" to "vpntest" so every programmer will recognize easily it is a test program. 2018-10-08 11:19:39 +09:00
0ce8ad7a2b At first, restore "Ham" project. This reverts commit 24d23feacf. 2018-10-08 11:13:48 +09:00
afe994f252 Mayaqua/OS: improve UnixGetOsInfo() so that it retrieves info on recent Linux/BSD systems 2018-10-07 01:38:02 +02:00
9970d6f657 Mayaqua/Memory: move and adapt entry list functions from Cedar/Proto_OpenVPN 2018-10-06 22:41:35 +02:00
34f443c0c7 Merge PR #718: src/Cedar/BridgeUnix.c: resolve null pointer dereference 2018-09-29 23:30:28 +02:00
aee6084b19 BridgeUnix.c: enable local bridge function on all BSD systems 2018-09-28 20:56:10 +02:00
ee9990317b Fix bugs reported by Coverity Scan. 2018-09-28 22:39:38 +09:00
60bb1c34de src/Cedar/BridgeUnix.c: resolve null pointer dereference
found by coverity
2018-09-28 16:17:20 +05:00
1fdc712e66 src/Cedar/Client.c: silence coverity regarding dead code 2018-09-24 11:19:54 +05:00
36dbde6f32 src/Cedar/Hub.c: resolve possible null pointer dereference
found by coverity
2018-09-24 11:13:43 +05:00
f449b0b405 Merge PR #704: vpncmd: Added information about "Disable UDP Acceleration" setting into output of AccountGet command. 2018-09-23 17:05:45 +02:00
3f5f716357 Revamp digest functions
- Hash() has been removed because it was ambiguous, Md5() and Sha0() are proper replacements.
- HMacMd5() and HMacSha1() now share a common implementation handled by the new Internal_HMac() function.
- NewMd() and MdProcess() now support plain hashing (without the key).
- NewMd(), SetMdKey() and MdProcess() now check the OpenSSL functions' return value and in case of failure a debug message is printed along with the error string, if available.
- SetMdKey()'s return value has been changed from void to bool, so that it's possible to know whether the function succeeded or not.
- MdProcess()' return value has been changed from void to UINT (unsigned int) and the function now returns the number of bytes written by HMAC_Final() or EVP_DigestFinal_ex().
2018-09-22 06:36:09 +02:00
a78bcb4f21 Merge PR #707: src/Cedar/Hub.c: resolve null pointer dereference found by coverity 2018-09-19 04:23:56 +02:00
621fffbfbd src/Cedar/Hub.c: resolve null pointer dereference found by coverity,
also cleanup a code based on PVS analyzer findings

src/Cedar/Hub.c	5279	warn	V547 Expression 'e->UpdatedTime <= oldest_time' is always true.
src/Cedar/Hub.c	5840	warn	V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 5828, 5840.
2018-09-18 10:52:04 +05:00
60a2583ee4 BridgeUnix.c: add TAP local bridge support for FreeBSD 2018-09-18 01:35:23 +02:00
cb2aec1314 BridgeUnix.c: convert line endings from CRLF to LF 2018-09-18 01:32:01 +02:00
f469e143fc src/Cedar/Client.c: remove not needed condition
inspired by coverity (however, coverity does not see an issue here)
2018-09-17 16:35:22 +05:00
825a5a828e vpncmd: Added information about "Disable UDP Acceleration" setting into output of AccountGet command. 2018-09-17 09:22:50 +03:00
4e30a40ae1 Enable debug messages and memory check with debug configuration 2018-09-15 19:12:21 +02:00
4974b2a13e src/Cedar/Radius: resolve several coverity "issues"
coverity thinks there might be null pointer dereference, make it
happier by removing check (there's a check against NULL in function itself).

condition "a.DataSize <= 1500" is always true
2018-09-14 11:05:24 +05:00
39858d7017 CMake: fix date/time leading 0 removal regex and print both during configuration
The previous regex expression removed all the 0s present in the input string, meaning that it caused the build to fail in case one of the date/time values was effectively 0.
2018-09-13 22:54:03 +02:00
83a8b5f4aa src/Cedar/Hub: resolve potential null pointer dereference, remove unused functions
found by coverity, cppcheck

[src/Cedar/Hub.c:6663]: (style) The function 'CalcTrafficEntryDiff' is never used.
[src/Cedar/Hub.c:3387]: (style) The function 'GetSessionByPtr' is never used.
[src/Cedar/Hub.c:3139]: (style) The function 'SetSessionFirstRedirectHttpUrl' is never used.
[src/Cedar/Hub.c:3912]: (style) The function 'VgsSetEmbTag' is never used.
[src/Cedar/Hub.c:3918]: (style) The function 'VgsSetUserAgentValue' is never used.
2018-09-13 23:39:09 +05:00
2017e43ad1 Clean up device name parsing code to eliminate Coverity errors 2018-09-13 19:22:00 +02:00
32082eb8af Proto_IkePacket.c: fix and improve IkeHMac() function
Pull request #294 added SHA-256, SHA-384, and SHA-512 support to the protocol, but part of it was removed in faee11ff09, because it caused a buffer over-read crash.

It also broke the MD5 implementation because the switch-case block didn't handle the type anymore.

This pull request fixes all the implementations and improves the IkeHMac() function by using the dedicated hashing functions.
2018-09-11 15:29:12 +02:00
1e6b99e3fe Cedar: replace "Interop_" and "IPsec_" with "Proto_" in the protocol-specific source/header files' names
"IPsec_IPC" has been renamed to "IPC" because it's not related to third-party protocols.
2018-09-10 00:46:29 +02:00