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

311 Commits

Author SHA1 Message Date
Daiyuu Nobori
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
Daiyuu Nobori
0ce8ad7a2b At first, restore "Ham" project. This reverts commit 24d23feacf. 2018-10-08 11:13:48 +09:00
Davide Beatrici
afe994f252 Mayaqua/OS: improve UnixGetOsInfo() so that it retrieves info on recent Linux/BSD systems 2018-10-07 01:38:02 +02:00
Davide Beatrici
9970d6f657 Mayaqua/Memory: move and adapt entry list functions from Cedar/Proto_OpenVPN 2018-10-06 22:41:35 +02:00
Davide Beatrici
34f443c0c7
Merge PR #718: src/Cedar/BridgeUnix.c: resolve null pointer dereference 2018-09-29 23:30:28 +02:00
Davide Beatrici
aee6084b19 BridgeUnix.c: enable local bridge function on all BSD systems 2018-09-28 20:56:10 +02:00
Daiyuu Nobori
ee9990317b Fix bugs reported by Coverity Scan. 2018-09-28 22:39:38 +09:00
Ilya Shipitsin
60bb1c34de src/Cedar/BridgeUnix.c: resolve null pointer dereference
found by coverity
2018-09-28 16:17:20 +05:00
Ilya Shipitsin
1fdc712e66 src/Cedar/Client.c: silence coverity regarding dead code 2018-09-24 11:19:54 +05:00
Ilya Shipitsin
36dbde6f32 src/Cedar/Hub.c: resolve possible null pointer dereference
found by coverity
2018-09-24 11:13:43 +05:00
Davide Beatrici
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
Davide Beatrici
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
Davide Beatrici
a78bcb4f21
Merge PR #707: src/Cedar/Hub.c: resolve null pointer dereference found by coverity 2018-09-19 04:23:56 +02:00
Ilya Shipitsin
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
Davide Beatrici
60a2583ee4 BridgeUnix.c: add TAP local bridge support for FreeBSD 2018-09-18 01:35:23 +02:00
Davide Beatrici
cb2aec1314 BridgeUnix.c: convert line endings from CRLF to LF 2018-09-18 01:32:01 +02:00
Ilya Shipitsin
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
mogikanin
825a5a828e vpncmd: Added information about "Disable UDP Acceleration" setting into output of AccountGet command. 2018-09-17 09:22:50 +03:00
Davide Beatrici
4e30a40ae1 Enable debug messages and memory check with debug configuration 2018-09-15 19:12:21 +02:00
Ilya Shipitsin
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
Davide Beatrici
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
Ilya Shipitsin
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
Bill Welliver
2017e43ad1 Clean up device name parsing code to eliminate Coverity errors 2018-09-13 19:22:00 +02:00
Davide Beatrici
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
Davide Beatrici
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
Ilya Shipitsin
db226eb4dd src/Cedar/Server: resolve possible null reference exception, remove unused functions, variable, duplicate assignment and conditional
found by coverity, cppcheck

[src/Cedar/Server.c:2899]: (style) Variable 'is_vgs_enabled' is assigned a value that is never used.
[src/Cedar/Server.c:3961]: (style) Variable 'id' is assigned a value that is never used.
[src/Cedar/Server.c:5723]: (style) Variable 'c' is assigned a value that is never used.
[src/Cedar/Server.c:5767]: (style) Variable 'num_connections_per_ip' is assigned a value that is never used.
[src/Cedar/Server.c:7327]: (style) Variable 'num' is assigned a value that is never used.
[src/Cedar/Server.c:8444]: (style) The function 'SiCallEnumHubBegin' is never used.
[src/Cedar/Server.c:8454]: (style) The function 'SiCallEnumHubEnd' is never used.
[src/Cedar/Server.c:9923]: (style) The function 'SiCallTaskAsyncBegin' is never used.
[src/Cedar/Server.c:9949]: (style) The function 'SiCallTaskAsyncEnd' is never used.
[src/Cedar/Server.c:10769]: (style) The function 'SiCheckCurrentRegion' is never used.
[src/Cedar/Server.c:2831]: (style) The function 'SiGetAzureEnable' is never used.
[src/Cedar/Server.c:208]: (style) The function 'SiGetServerNumUserObjects' is never used.
[src/Cedar/Server.c:2435]: (style) The function 'SiInitBridge' is never used.
[src/Cedar/Server.c:2540]: (style) The function 'SiTest' is never used.
[src/Cedar/Server.c:6707]: (style) The function 'StGetServer' is never used.
2018-09-01 17:49:08 +05:00
Ilya Shipitsin
b5f391016e src/Cedar/BridgeUnix.c: resolve possible null pointer dereference
found by coverity
2018-09-01 15:00:42 +05:00
Ilya Shipitsin
156166dba1 src/Cedar/Hub: resolve null pointer dereference found by coverity 2018-08-31 00:59:06 +05:00
Ilya Shipitsin
9675b0eb6d src/Cedar/IPsec_EtherIP: resolve "Identical code for different branches"
found by coverity
2018-08-31 00:56:00 +05:00
Ilya Shipitsin
2c2caa81bc src/Cedar/Interop_OpenVPN: resolve coverity "issue"
coverity thinks there might be null pointer dereference. we can
safely remove a check here, because OvsFreePacket checks for null
itself
2018-08-31 00:50:53 +05:00
Ilya Shipitsin
c81dfc0e58 src/Cedar/Session: modify code to avoid "Identical code for different branches", remove unused functions.
found by coverity, cppcheck

[src/Cedar/Session.c:1856]: (style) The function 'CompareSession' is never used.
[src/Cedar/Session.c:2384]: (style) The function 'DebugPrintSessionKey' is never used.
[src/Cedar/Session.c:2102]: (style) The function 'GetSessionFromKey32' is never used.
2018-08-29 12:36:09 +05:00
Davide Beatrici
3f8fa9d5d9
Merge PR #673: Cedar: custom TAP interface name support for FreeBSD, function refactor 2018-08-28 14:08:03 +02:00
Davide Beatrici
9d601c2745 CMake: set build info as compiler macros 2018-08-27 05:50:40 +02:00
Davide Beatrici
c21f427fc6 Divide version in multiple macros and set default values 2018-08-27 05:44:32 +02:00
Davide Beatrici
7f9177f3d7
Merge PR #671: resolve several coverity issues 2018-08-27 01:22:27 +02:00
Davide Beatrici
dbb0bb83f7 Cedar: fix segmentation fault during local bridge creation on FreeBSD 2018-08-27 00:46:59 +02:00
Davide Beatrici
37ced5c479 Cedar: custom TAP interface name support for FreeBSD, function refactor
The maximum number of TAP devices to iterate through has been increased from 16 to 512.
2018-08-26 04:20:57 +02:00
Ilya Shipitsin
dcd03476c4 src/Cedar/Connection: resolve null pointer dereference found by coverity,
remove unused function

[src/Cedar/Connection.c:2861]: (style) The function 'InitTcpSockRc4Key' is never used.
2018-08-24 15:26:14 +05:00
Ilya Shipitsin
a58d26f125 src/Cedar/IPsec_IKE.c: resolve null pointer dereference found by coverity,
remove unused variable

[src/Cedar/IPsec_IKE.c:4332] -> [src/Cedar/IPsec_IKE.c:4332]: (style) Same expression on both sides of '||'.
[src/Cedar/IPsec_IKE.c:1665]: (style) Variable 'zero' is assigned a value that is never used.
2018-08-24 15:25:34 +05:00
Ilya Shipitsin
2f7d71a567 src/Cedar/Cedar.c: resolve "Identical code for different branches", remove unused functions
found by coverity, cppcheck

[src/Cedar/Cedar.c:1605]: (style) The function 'EnableDebugLog' is never used.
[src/Cedar/Cedar.c:858]: (style) The function 'GetUnestablishedConnections' is never used.
[src/Cedar/Cedar.c:652]: (style) The function 'InitHiddenPassword' is never used.
[src/Cedar/Cedar.c:633]: (style) The function 'IsHiddenPasswordChanged' is never used.
[src/Cedar/Cedar.c:393]: (style) The function 'IsInNoSsl' is never used.
[src/Cedar/Cedar.c:1785]: (style) The function 'IsLaterBuild' is never used.
2018-08-24 15:23:45 +05:00
Davide Beatrici
3ff5c061d7 Add TAP devices support for FreeBSD and OpenBSD
Thanks to @kennylam777 for the first implementation: https://github.com/kennylam777/SoftEtherVPN/commits/FreeBSD-TAP
2018-08-23 10:56:30 +02:00
Davide Beatrici
7612c2bf5d Cedar: fix compilation on FreeBSD, broken by #337 2018-08-23 04:39:13 +02:00
Ilya Shipitsin
a2d5fb7015 src/Cedar/Client.c: remove redundant "if" statement, unused variable
found by coverity, cppcheck

[src/Cedar/Client.c:9094]: (style) Unused variable: i
[src/Cedar/Client.c:500] -> [src/Cedar/Client.c:503]: (style) Variable 'ret' is reassigned a value before the old one has been used.
2018-08-22 20:58:03 +05:00
Ilya Shipitsin
e8c6e2c1d9 src/Cedar/Client.c, src/Mayaqua/Network.c, src/Mayaqua/Unix.c: silence coverity 2018-08-22 10:40:13 +05:00
Ilya Shipitsin
5ecc80a14e src/Cedar/Virtual: coverity suspects null pointer dereference here
however, both Cancel() and ReleaseCancel() checks for NULL themselves,
so we can remove this check
2018-08-22 10:33:29 +05:00
Davide Beatrici
233b525d0e
Merge PR #662: Fix that virtual NAT session is closed even if data remains. 2018-08-21 13:04:06 +02:00
MtCedarNet
f9de4a06aa Fix that virtual NAT session is closed even if data remains. 2018-08-21 18:54:07 +09:00
Ilya Shipitsin
99cdd9fe92 src/Cedar/Protocol: remove dead code, silence coverity 2018-08-21 11:55:37 +05:00
Ilya Shipitsin
c98c7858bd src/Cedar/Virtual: resolve null pointer dereference
found by coverity
2018-08-21 11:36:01 +05:00
Ilya Shipitsin
f3ff7e2743 src/Cedar/BridgeUnix: resolve coverity "issue" 2018-08-21 11:04:48 +05:00
Ilya Shipitsin
b0ebd1f1d5 src/Cedar/Client: remove dead code, unused functions, variables
found by coverity, cppcheck

[src/Cedar/Client.c:10486]: (style) The function 'CiFreeInnerVPNServer' is never used.
[src/Cedar/Client.c:10877]: (style) The function 'CiGetNumActiveSessions' is never used.
[src/Cedar/Client.c:2042]: (style) The function 'CiHasAccountSensitiveInformationFile' is never used.
[src/Cedar/Client.c:10469]: (style) The function 'CiNewInnerVPNServer' is never used.
[src/Cedar/Client.c:1128]: (style) The function 'CncGetSessionId' is never used.
[src/Cedar/Client.c:767]: (style) The function 'CncPasswordDlgHaltThread' is never used.
[src/Cedar/Client.c:10681]: (style) The function 'CompareInternetSetting' is never used.
[src/Cedar/Client.c:11060]: (style) The function 'CtGetClient' is never used.
[src/Cedar/Client.c:5128]: (style) The function 'InRpcClientNotify' is never used.
[src/Cedar/Client.c:4340]: (style) The function 'InRpcEnumObjectInSecure' is never used.
[src/Cedar/Client.c:5140]: (style) The function 'OutRpcClientNotify' is never used.
[src/Cedar/Client.c:5657]: (style) Condition 'reg_port!=0' is always false
[src/Cedar/Client.c:683]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Client.c:725]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Client.c:1013]: (style) Variable 'param' is assigned a value that is never used.
2018-08-18 19:24:12 +05:00
Ilya Shipitsin
29c991c487 src/Cedar/BridgeUnix: null pointer dereference resolved, unused variables, functions removed
found by coverity, cppcheck

[src/Cedar/BridgeUnix.c:270] -> [src/Cedar/BridgeUnix.c:279]: (style) Variable 'ret' is reassigned a value before the old one has been used.
[src/Cedar/BridgeUnix.c:560] -> [src/Cedar/BridgeUnix.c:569]: (style) Variable 't' is reassigned a value before the old one has been used.
[src/Cedar/BridgeUnix.c:1528] -> [src/Cedar/BridgeUnix.c:1537]: (style) Variable 'ret' is reassigned a value before the old one has been used.
[src/Cedar/BridgeUnix.c:1278]: (style) Unused variable: c
[src/Cedar/BridgeUnix.c:1090]: (style) The function 'DlipAttachRequest' is never used.
2018-08-18 18:59:51 +05:00
Ilya Shipitsin
c4d1a10c2a src/Cedar/Command: remove dead code, null pointer dereference, unused functions, variables
found by coverity, cppcheck

[src/Cedar/Command.c:9378]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Command.c:9999]: (style) The function 'CmdEvalNetworkAndSubnetMask6' is never used.
2018-08-18 17:55:24 +05:00
Davide Beatrici
0d966755d7
Merge PR #659: resolve cosmetic coverity issues 2018-08-18 08:09:22 +02:00
Davide Beatrici
daed1ad8b3
Merge PR #594: Remove SSLv3 support 2018-08-18 07:38:05 +02:00
Ilya Shipitsin
a71589e027 src/Cedar/EtherLog: silence coverity, remove unused functions
found by coverity, cppcheck

[src/Cedar/EtherLog.c:327]: (style) The function 'EcAddLicenseKey' is never used.
[src/Cedar/EtherLog.c:385]: (style) The function 'ElCheckLicense' is never used.
2018-08-18 10:25:30 +05:00
Ilya Shipitsin
e460f26b19 src/Cedar/IPsec_PPP: remove dead code, unused fuction
found by coverity, cppcheck

[src/Cedar/IPsec_PPP.c:2655]: (style) The function 'MsChapV2Client_GenerateChallenge' is never used.
2018-08-18 00:34:42 +05:00
Ilya Shipitsin
8a9309bedf src/Cedar/Command: remove dead code, unused variables and functions
found by cppcheck and coverity

[src/Cedar/Command.c:523] -> [src/Cedar/Command.c:532]: (style) Variable 'ok' is reassigned a value before the old one has been used.
[src/Cedar/Command.c:776]: (style) Variable 'tick2' is assigned a value that is never used.
[src/Cedar/Command.c:2244]: (style) Variable 'halt_timeout' is assigned a value that is never used.
[src/Cedar/Command.c:2246]: (style) Variable 'check_clock_seed' is assigned a value that is never used.
[src/Cedar/Command.c:2247]: (style) Variable 'halting' is assigned a value that is never used.
[src/Cedar/Command.c:6904]: (style) Unused variable: tmp
[src/Cedar/Command.c:12217]: (style) Variable 'packet_log' is assigned a value that is never used.
[src/Cedar/Command.c:20825]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Command.c:20883]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Command.c:20927]: (style) Variable 'ret' is assigned a value that is never used.
[src/Cedar/Command.c:10022]: (style) The function 'CmdEvalIpAndMask46' is never used.
[src/Cedar/Command.c:10109]: (style) The function 'CmdEvalNetworkAndSubnetMask46' is never used.
[src/Cedar/Command.c:23025]: (style) The function 'CmdPrintRow' is never used.
[src/Cedar/Command.c:167]: (style) The function 'InRpcTtResult' is never used.
[src/Cedar/Command.c:148]: (style) The function 'OutRpcTtResult' is never used.
2018-08-15 19:04:17 +05:00
Davide Beatrici
2692bb6b8e Interop_OpenVPN: set "subnet" topology and remove workaround for "net30" topology on Win32
The workaround was required for the "net30" topology because:
"There is a problem in your selection of --ifconfig endpoints [local=192.168.30.10, remote=192.168.30.1]. The local and remote VPN endpoints must exist within the same 255.255.255.252 subnet. This is a limitation of --dev tun when used with the TAP-WIN32 driver. Try 'openvpn --show-valid-subnets' option for more info."

See https://community.openvpn.net/openvpn/wiki/Topology for detailed info.
2018-08-15 02:39:33 +02:00
Ilya Shipitsin
f96a3b3989 src/Cedar/EtherLog: remove null dereference introduced in #650
also, remove unused functions:

[src/Cedar/EtherLog.c:1377]: (style) The function 'ElFree' is never used.
[src/Cedar/EtherLog.c:1370]: (style) The function 'ElInit' is never used.
2018-08-14 02:36:28 +05:00
Ilya Shipitsin
eb4efe3f1b src/Cedar/Session.c: avoid unintentional integer overflow
found by coverity
2018-08-13 15:40:45 +05:00
Ilya Shipitsin
ff1470cdce src/Cedar/Nat.c: resolve possible null dereference
found by coverity
2018-08-13 15:40:17 +05:00
Ilya Shipitsin
937da4a746 src/Cedar/EtherLog.c: resolve possible null dereference
found by coverity
2018-08-13 15:39:29 +05:00
Ilya Shipitsin
3ca4bc0aa9 src/Cedar/Logging: remove unused functions, redundant condition
[src/Cedar/Logging.c:679]: (style) The function 'HubLog' is never used.
[src/Cedar/Logging.c:888]: (style) The function 'IPCLog' is never used.
[src/Cedar/Logging.c:295]: (style) The function 'PrintEraseFileList' is never used.
[src/Cedar/Logging.c:1025]: (style) The function 'SecLog' is never used.
[src/Cedar/Logging.c:622]: (style) The function 'ServerLog' is never used.
[src/Cedar/Logging.c:2273]: (style) The function 'SetLogDirName' is never used.
[src/Cedar/Logging.c:2293]: (style) The function 'SetLogPrefix' is never used.
[src/Cedar/Logging.c:997]: (style) The function 'WriteMultiLineLog' is never used.
[src/Cedar/Logging.c:918]: (style) The function 'WriteSecurityLog' is never used.
[src/Cedar/Logging.c:1018] -> [src/Cedar/Logging.c:1006]:

(warning) Either the condition 'src_session!=NULL' is redundant or there is possible null
pointer dereference: src_session.
2018-08-13 07:13:56 +05:00
Ilya Shipitsin
6af1a2eb46 src/Cedar/Interop_OpenVPN: remove unused functions and variables
[src/Cedar/Interop_OpenVPN.c:2711]: (style) Variable 'now' is assigned a value that is never used.
[src/Cedar/Interop_OpenVPN.c:1053]: (style) The function 'OvsAddEntry' is never used.
[src/Cedar/Interop_OpenVPN.c:2610]: (style) The function 'OvsGetCompatibleL3IPNext' is never used.
[src/Cedar/Interop_OpenVPN.c:1047]: (style) The function 'OvsNewList' is never used.
[src/Cedar/Interop_OpenVPN.c:128]: (style) The function 'OvsSetNoOpenVpnTcp' is never used.
[src/Cedar/Interop_OpenVPN.c:140]: (style) The function 'OvsSetNoOpenVpnUdp' is never used.
2018-08-13 07:00:33 +05:00
Ilya Shipitsin
a7933800d0 src/Cedar/Logging.c: remove logically dead code
found by coverity
2018-08-12 16:22:09 +05:00
Ilya Shipitsin
2103520728 src/Cedar/Server.c: remove logically dead code
found by coverity
2018-08-12 16:19:29 +05:00
Ilya Shipitsin
b8af87adc1 src/Cedar/Interop_OpenVPN.c: remove logically dead code
found by coverity
2018-08-12 16:17:56 +05:00
Ilya Shipitsin
981e8d0e77 src/Cedar/Protocol.c: remove logically dead code
found by coverity
2018-08-12 16:15:53 +05:00
Ilya Shipitsin
e302cb5f74 src/Cedar/IPsec_PPP.c: remove logically dead code
found by coverity
2018-08-12 16:12:48 +05:00
Ilya Shipitsin
595245cd45 src/Cedar/IPsec_PPP.c: remove logically dead code
found by coverity
2018-08-12 16:07:13 +05:00
Ilya Shipitsin
ad41d54b29 src/Cedar/Command.c: remove logically dead code
found by coverity
2018-08-12 16:03:10 +05:00
Davide Beatrici
d3fc90f4e0
Merge PR #641: resolve several issues found by coverity 2018-08-12 12:28:49 +02:00
Davide Beatrici
3e4a2cabd8
Merge PR #640: Protocol: remove RC4 related stuff 2018-08-12 12:20:04 +02:00
Davide Beatrici
97a9070269
Merge PR #638: Interop_OpenVPN.c: convert the cipher name to lowercase prior to calling EVP_get_cipherbyname() 2018-08-12 12:18:50 +02:00
Ilya Shipitsin
35dc165651 src/Cedar/IPsec_PPP.c: avoid unintentional integer overflow
found by coverity
2018-08-12 15:10:44 +05:00
Ilya Shipitsin
3da4a9c5e3 src/Cedar/Hub.c: avoid unintentional integer overflow
found by coverity
2018-08-12 15:09:18 +05:00
Ilya Shipitsin
cb55ba6e7f src/Cedar/Session.c: avoid unintentional integer overflow
found by coverity
2018-08-12 15:07:34 +05:00
Ilya Shipitsin
89e3eb5ada src/Cedar/IPsec_IKE.c: avoid unintentional integer overflow
found by coverity
2018-08-12 15:05:48 +05:00
Ilya Shipitsin
2be6128e23 src/Cedar/IPsec_PPP.c: Array compared against NULL is always false
found by coverity
2018-08-12 15:00:17 +05:00
Ilya Shipitsin
b8d5a85b0e src/Cedar/Client.c: Array compared against NULL is always false
found by coverity
2018-08-12 14:59:08 +05:00
Davide Beatrici
eb03d1c54b Protocol: remove RC4 related stuff 2018-08-12 04:07:39 +02:00
Davide Beatrici
3e733eac6f Interop_OpenVPN.c: convert the cipher name to lowercase prior to calling EVP_get_cipherbyname()
OpenVPN sends the cipher name in uppercase, even if it's not standard, thus we have to convert it to lowercase for EVP_get_cipherbyname().

We also have to send the cipher name as it was received from the OpenVPN client, unless it's a different cipher, to prevent a message such as:
"WARNING: 'cipher' is used inconsistently, local='cipher AES-128-GCM', remote='cipher aes-128-gcm'"
It happens because OpenVPN uses "strcmp()" to compare the local and remote parameters: a6fd48ba36/src/openvpn/options.c (L3819-L3831)

See https://github.com/openssl/openssl/issues/6921 for EVP_get_cipherbyname().
2018-08-12 01:03:56 +02:00
Ilya Shipitsin
dd2c1c0dcd src/Cedar/DDNS.c: "interval" is unsigned, so MIN can only return 0
found by coverity
2018-08-11 21:49:27 +02:00
Davide Beatrici
84c44fbe24 Console.c: fix "implicit declaration of function 'getch'" warning
/builds/SoftEther/SoftEtherVPN/src/Cedar/Console.c: In function 'PasswordPrompt':
/builds/SoftEther/SoftEtherVPN/src/Cedar/Console.c:2051:8: warning: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
    c = getch();
        ^~~~~
        getc
2018-08-10 21:22:36 +02:00
Davide Beatrici
49ed8770b8 VLanUnix: fix "implicit declaration of function 'FreeTap'" warning
In file included from /builds/SoftEther/SoftEtherVPN/src/Cedar/Bridge.c:130:0:
/builds/SoftEther/SoftEtherVPN/src/Cedar/BridgeUnix.c: In function 'CloseEth':
/builds/SoftEther/SoftEtherVPN/src/Cedar/BridgeUnix.c:1568:3: warning: implicit declaration of function 'FreeTap'; did you mean 'FreeCaps'? [-Wimplicit-function-declaration]
   FreeTap(e->Tap);
   ^~~~~~~
   FreeCaps
2018-08-10 21:21:19 +02:00
Davide Beatrici
02db806181 Remove SSLv3 support 2018-08-09 00:25:40 +02:00
Ilya Shipitsin
d65f292888
Merge pull request #615 from prodatakey/foreground-logging
Merge PR #615: Foreground logging
2018-08-08 08:51:41 +05:00
Joshua Perry
e1bc2fd055 Remove last priority flag in deference to queue size checks 2018-08-06 10:28:37 -06:00
Mikhail Pridushchenko
02da8079ee UNIX services write logs to stdout
To better adopt SoftEther VPN for execution in Docker container all
services output logs to stdout if running in foreground.
2018-08-06 08:51:24 -06:00
Davide Beatrici
b70d81b5a8
Merge PR #613: WinUi: remove unused functions 2018-08-06 14:56:49 +02:00
Davide Beatrici
21e9bb354e WinUi: remove unneeded WinUiDebugInit() and WinUiDebugFree() functions 2018-08-06 14:45:54 +02:00
Ilya Shipitsin
005b5ebeca src/Cedar/WinUi: remove unused functions
[src/Cedar/WinUi.c:7240]: (style) The function 'CbInsertStr' is never used.
[src/Cedar/WinUi.c:9271]: (style) The function 'CheckTextLen' is never used.
[src/Cedar/WinUi.c:9252]: (style) The function 'CheckTextSize' is never used.
[src/Cedar/WinUi.c:8936]: (style) The function 'DialogCreateEx' is never used.
[src/Cedar/WinUi.c:2155]: (style) The function 'EndFreeInfoDlg' is never used.
[src/Cedar/WinUi.c:2171]: (style) The function 'ExecuteHamcoreExe' is never used.
[src/Cedar/WinUi.c:9885]: (style) The function 'FormatTextA' is never used.
[src/Cedar/WinUi.c:9323]: (style) The function 'GetFontSize' is never used.
[src/Cedar/WinUi.c:9841]: (style) The function 'GetMonitorSize' is never used.
[src/Cedar/WinUi.c:9759]: (style) The function 'GetWindowClientRect' is never used.
[src/Cedar/WinUi.c:1134]: (style) The function 'GetWizardPageIndex' is never used.
[src/Cedar/WinUi.c:3964]: (style) The function 'IpClear' is never used.
[src/Cedar/WinUi.c:6851]: (style) The function 'LbAddStr' is never used.
[src/Cedar/WinUi.c:6824]: (style) The function 'LbFindStr' is never used.
[src/Cedar/WinUi.c:7064]: (style) The function 'LbGetSelect' is never used.
[src/Cedar/WinUi.c:6812]: (style) The function 'LbGetStr' is never used.
[src/Cedar/WinUi.c:6900]: (style) The function 'LbInsertStr' is never used.
[src/Cedar/WinUi.c:7012]: (style) The function 'LbSetHeight' is never used.
[src/Cedar/WinUi.c:3652]: (style) The function 'LedDrawRect' is never used.
[src/Cedar/WinUi.c:6000]: (style) The function 'LvGetMaskedNum' is never used.
[src/Cedar/WinUi.c:6037]: (style) The function 'LvSearchStr_' is never used.
[src/Cedar/WinUi.c:5703]: (style) The function 'LvSetItemImage' is never used.
[src/Cedar/WinUi.c:5831]: (style) The function 'LvShow' is never used.
[src/Cedar/WinUi.c:10155]: (style) The function 'NoTop' is never used.
[src/Cedar/WinUi.c:10047]: (style) The function 'NoticeSettingChange' is never used.
[src/Cedar/WinUi.c:7854]: (style) The function 'PkcsUtil' is never used.
[src/Cedar/WinUi.c:8968]: (style) The function 'SetBitmap' is never used.
[src/Cedar/WinUi.c:4539]: (style) The function 'SetMenuItemEnable' is never used.
[src/Cedar/WinUi.c:9918]: (style) The function 'SetTextEx' is never used.
[src/Cedar/WinUi.c:9940]: (style) The function 'SetTextExA' is never used.
[src/Cedar/WinUi.c:11272]: (style) The function 'SetWinUiTitle' is never used.
[src/Cedar/WinUi.c:2132]: (style) The function 'StartFreeInfoDlg' is never used.
[src/Cedar/WinUi.c:3920]: (style) The function 'UiTest' is never used.
[src/Cedar/WinUi.c:1558]: (style) The function 'WinConnectEx2' is never used.
[src/Cedar/WinUi.c:10803]: (style) The function 'WinUiDebug' is never used.
[src/Cedar/WinUi.c:6908]: (style) The function 'CbInsertStr9xA' is never used.
[src/Cedar/WinUi.c:2096]: (style) The function 'FreeInfoThread' is never used.
[src/Cedar/WinUi.c:9644]: (style) The function 'GetTextSize' is never used.
[src/Cedar/WinUi.c:2833]: (style) The function 'GetWindowAndControlSizeResizeScale' is never used.
[src/Cedar/WinUi.c:2001]: (style) The function 'IsRegistedToDontShowFreeEditionDialog' is never used.
[src/Cedar/WinUi.c:6606]: (style) The function 'LbAddStrA' is never used.
[src/Cedar/WinUi.c:6739]: (style) The function 'LbGetSelectIndex' is never used.
[src/Cedar/WinUi.c:6627]: (style) The function 'LbInsertStrA' is never used.
[src/Cedar/WinUi.c:7593]: (style) The function 'PkcsUtilProc' is never used.
[src/Cedar/WinUi.c:6598]: (style) The function 'LbSelect' is never used.
[src/Cedar/WinUi.c:7421]: (style) The function 'PkcsUtilErase' is never used.
[src/Cedar/WinUi.c:7349]: (style) The function 'PkcsUtilWrite' is never used.
[src/Cedar/WinUi.c:2059]: (style) The function 'ShowFreeInfoDialog' is never used.
[src/Cedar/WinUi.c:2013]: (style) The function 'FreeInfoDialogProc' is never used.
[src/Cedar/WinUi.c:6558]: (style) The function 'LbFindData' is never used.
[src/Cedar/WinUi.c:6534]: (style) The function 'LbSelectIndex' is never used.
[src/Cedar/WinUi.c:6488]: (style) The function 'LbGetData' is never used.
[src/Cedar/WinUi.c:6464]: (style) The function 'LbNum' is never used.
[src/Cedar/WinUi.c:2001]: (style) The function 'RegistToDontShowFreeEditionDialog' is never used.
2018-08-06 13:43:23 +05:00
Ilya Shipitsin
e969749bc1 initialize variables (it makes coverity a bit happier) 2018-08-06 12:40:06 +05:00
Davide Beatrici
59000e04cc Merge PR #335: Retry connection on untrusted server certificate 2018-08-05 21:15:52 +02:00
Joshua Perry
28e8d4bcce Retry connection on untrusted server certificate
With server certificate validation enabled, vpnclient unconditionally
stopped connection on untrusted server certificate. Added account
configuration parameter to retry connection if server certivicate failed
validation.
2018-08-05 20:48:16 +02:00
Davide Beatrici
d4d17549c4
Merge PR #337: Put TUN down on client disconnect. 2018-08-05 20:16:50 +02:00
Ilya Shipitsin
191c680ff7 src/Cedar/Admin.c: remove unused condition, make coverity scan cleaner
HubName == NULL  always evaluated as "false", so we can remove it
2018-08-05 22:33:16 +05:00
Joshua Perry
59e1483dbf Put TUN down on client disconnect.
On startup client creates TUN interface in UP state and kept it UP even
if connection to the server was lost. Creating interface in DOWN state,
turning it UP on successful (re-)connection to server and DOWN on either
disconnect or connection loss would enable DHCP client (say dhclient5)
to detect necessity for lease renewal.

Added a client configuration parameter to create TUN interface in DOWN
state and commands to enable, disable, and query the configuration
parameter.
Enabling the parameter causes client to put all unused TUN interfaces
DOWN, create new TUN interfaces in DOWN state, and turn TUN interfaces
corresponding to active sessions DOWN on connection loss or
disconnecting from server.
Disabling the parameter forces client to turn all TUN interfaces UP and
create new TUN interfaces in UP state.
Default value is 'Disable'.
2018-08-05 17:36:05 +02:00
Ilya Shipitsin
1c0b961aa5 remove DoNothing function (improves coverity reports) 2018-08-05 12:00:39 +05:00