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

209 Commits

Author SHA1 Message Date
Daiyuu Nobori
c407f35322 SHA-0 Implementation replacement from GPLv3 to Apache License 2018-12-02 10:30:22 +09:00
Davide Beatrici
aefbd2e903 Add custom HTTP header feature for HTTP proxy
A custom HTTP header can be used to bypass certain restrictions imposed on the network or to avoid speed limitations applied by the QoS.
2018-11-29 20:32:21 +01:00
Ilya Shipitsin
9e250e62be src/Mayaqua/Mayaqua: remove unused functions
found by cppcheck

[src/Mayaqua/Mayaqua.c:753]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.
[src/Mayaqua/Mayaqua.c:484]: (style) The function 'IsUnicode' is never used.
[src/Mayaqua/Mayaqua.c:438]: (style) The function 'MayaquaDotNetMode' is never used.
[src/Mayaqua/Mayaqua.c:774]: (style) The function 'PrintOsInfo' is never used.
2018-11-30 00:01:11 +05:00
Davide Beatrici
04188f8606 CMake: change project name to "SoftEther VPN", create and use "TOP_DIRECTORY" variable 2018-11-27 05:00:30 +01:00
Ilya Shipitsin
d72329c007 src/Mayaqua/Cfg: remove unused functions, variables
found by cppcheck

[src/Mayaqua/Cfg.c:669]: (style) Variable 'invalid_file' is assigned a value that is never used.
[src/Mayaqua/Cfg.c:2111]: (style) Variable 'v' is assigned a value that is never used.
[src/Mayaqua/Cfg.c:1114]: (style) The function 'CfgFolderToBufText' is never used.
[src/Mayaqua/Cfg.c:539]: (style) The function 'CfgRead' is never used.
[src/Mayaqua/Cfg.c:418]: (style) The function 'CfgSave' is never used.
[src/Mayaqua/Cfg.c:1425]: (style) The function 'CfgStrToType' is never used.
[src/Mayaqua/Cfg.c:708]: (style) The function 'CfgTest' is never used.
[src/Mayaqua/Cfg.c:704]: (style) The function 'CfgTest2' is never used.
[src/Mayaqua/Cfg.c:247]: (style) The function 'NewCfgRwW' is never used.
2018-11-27 01:52:27 +05:00
Davide Beatrici
c48de5924a Mayaqua: ability to toggle memory tracking at runtime, various logic improvements 2018-11-18 04:18:51 +01:00
Davide Beatrici
e1bd84d7f3 CMake: set PDB output directory, don't set default build type 2018-11-18 04:18:42 +01:00
Davide Beatrici
f154cf1cec Mayaqua/Encrypt.h: fix missing AEAD macro for OpenBSD 2018-11-08 19:24:42 +01:00
Davide Beatrici
ba930668ba
Merge PR #796: Cedar/Proto_OpenVPN: add support for GCM ciphers 2018-11-04 01:01:10 +01:00
Ilya Shipitsin
6440521f81 src/Mayaqua/Network.c: remove reccuring check
found by PVS analyzer

src/Mayaqua/Network.c	18715	err	V571 Recurring check. The 'if (u->GetNatTIpThread == NULL)' condition was already verified in line 18712.
2018-11-04 01:04:58 +05:00
Ilya Shipitsin
87702f0f7d src/Mayaqua/OS: remove unused functions
found by cppcheck

[src/Mayaqua/OS.c:493]: (style) The function 'OSDec32' is never used.
[src/Mayaqua/OS.c:373]: (style) The function 'OSDeleteDir' is never used.
[src/Mayaqua/OS.c:393]: (style) The function 'OSFileCreate' is never used.
[src/Mayaqua/OS.c:353]: (style) The function 'OSFileDelete' is never used.
[src/Mayaqua/OS.c:383]: (style) The function 'OSFileOpen' is never used.
[src/Mayaqua/OS.c:331]: (style) The function 'OSFileRename' is never used.
[src/Mayaqua/OS.c:487]: (style) The function 'OSInc32' is never used.
[src/Mayaqua/OS.c:363]: (style) The function 'OSMakeDir' is never used.
[src/Mayaqua/OS.c:541]: (style) The function 'OSResetEvent' is never used.
2018-11-04 00:41:12 +05:00
Davide Beatrici
aae9ec0492 Mayaqua/Encrypt: add CipherProcessAead() function to encrypt/decrypt with AEAD ciphers 2018-11-03 15:14:56 +01:00
Ilya Shipitsin
8da2464831
Merge pull request #781 from chipitsine/BN_free
Merge PR #781: src/Mayaqua/Encrypt.c: fix memory leak occasionally found by valgrind
2018-10-29 14:22:45 +05:00
Ilya Shipitsin
5e75a1fb99 src/Mayaqua/Encrypt.c: fix memory leak occasionally found by valgrind 2018-10-29 10:52:56 +05:00
Daiyuu Nobori
4e4db36c11 Fix a single memory leak in loading the string table. 2018-10-29 14:48:15 +09:00
Davide Beatrici
c1f522c10e CMake: add support for Windows (Visual C++ 2017 toolset) 2018-10-24 21:25:57 +02:00
Davide Beatrici
3429e1bf31 CMake: build Cedar and Mayaqua as shared libraries, create "common" package 2018-10-20 13:12:49 +02:00
Ilya Shipitsin
68f1260f2c src/Mayaqua/MayaType.h: fix extra bracket
reported by @paskal
2018-10-14 20:40:28 +05:00
Davide Beatrici
e496f33455 Memory.c: fix pointer cast in TrackChangeObjSize() call
This commit fixes the "TrackDeleteObj: 0x12345678 is not Object!!" (where 0x12345678 is the actual address) errors with memcheck enabled.

It also fixes the following related warnings:

warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  TrackChangeObjSize((DWORD)addr, size, (DWORD)new_addr);
                     ^
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  TrackChangeObjSize((DWORD)addr, size, (DWORD)new_addr);
                                        ^
2018-10-14 07:51:53 +02:00
Davide Beatrici
ec7a9d7281 MayaType.h: fix pointer casting warnings
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 #define POINTER_TO_KEY(p)  ((sizeof(void *) == sizeof(UINT)) ? (UINT)(p) : HashPtrToUINT(p))
                                                                ^

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define UINT64_TO_POINTER(i) ((sizeof(void *) == sizeof(UINT64)) ? (void *)(i) : (void *)((UINT)(i)))
                                                                                  ^

warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 #define POINTER_TO_UINT64(p) (((sizeof(void *) == sizeof(UINT64)) ? (UINT64)(p) : (UINT64)((UINT)(p))))
                                                                                            ^
2018-10-14 07:24:18 +02:00
Ilya Shipitsin
ec09309aa8 gitlab-ci: enable ubuntu 12.04 builds 2018-10-12 01:03:12 +05:00
Daiyuu Nobori
8df347c093 Added OpenSSL 1.1.1 .lib files for Visual Studio 2008. 2018-10-09 20:30:03 +09:00
Daiyuu Nobori
baff1b349c Win32 OpenSSL Header File: Ver 1.0.2j -> Ver 1.1.1 2018-10-09 19:29:11 +09:00
Davide Beatrici
03d78693a3
Merge PR #735: Debug flag and test mode improvements 2018-10-08 21:00:44 +02:00
Davide Beatrici
8ddd336c38
Merge PR #736: vpntest project for programmers: runs VPN Server / VPN Client / VPN Bridge in test mode with full debug console output and memory leak checks 2018-10-08 06:33:47 +02:00
Daiyuu Nobori
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
Daiyuu Nobori
ee208dd6f0 Finally, the implementation of test code is completed! Ha ha ha 2018-10-08 11:50:11 +09:00
Davide Beatrici
9fa9f6cdc1 Mayaqua/Network.c: improve RecvFrom() and RecvFrom6()
This commit improves the RecvFrom() and RecvFrom6() functions by:
- Using the right data type for the struct size variable passed to recvfrom().
- Improving the arguments validation mechanism.
- Printing unhandled errors.
2018-10-08 03:21:10 +02: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
335e0503c9 Mayaqua/Str: add TrimQuotes() function to remove quotes from a string 2018-10-06 22:42:29 +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
e02237f397 Add string for "IF_TYPE_PROP_VIRTUAL" network interface type 2018-10-03 09:10:27 +02:00
Davide Beatrici
00f66616d2
Merge PR #721: Encrypt.c: fix MdProcess()'s HMAC implementation 2018-10-01 19:08:38 +02:00
Davide Beatrici
34f443c0c7
Merge PR #718: src/Cedar/BridgeUnix.c: resolve null pointer dereference 2018-09-29 23:30:28 +02:00
Ilya Shipitsin
564ca6087f src/Mayaqua/Object.c: remove redundant conditionals
found by PVS analyzer

src/Mayaqua/Object.c	318	warn	V547 Expression 'c->Ready == 0' is always false.
src/Mayaqua/Object.c	348	warn	V547 Expression 'c->Ready == 0' is always false.
src/Mayaqua/Object.c	383	warn	V547 Expression 'c->Ready == 0' is always false.
2018-09-29 00:39:01 +05:00
Daiyuu Nobori
ee9990317b Fix bugs reported by Coverity Scan. 2018-09-28 22:39:38 +09:00
Davide Beatrici
53c8abfd80 Encrypt.c: fix MdProcess()'s HMAC implementation 2018-09-27 20:28:48 +02:00
Davide Beatrici
50b42070e2 Encrypt: reorder digest functions 2018-09-22 06:47:03 +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
4e30a40ae1 Enable debug messages and memory check with debug configuration 2018-09-15 19:12:21 +02:00
Ilya Shipitsin
56681d41a0 src/Mayaqua/Kernel: remove unused variable, functions
found by cppcheck

[src/Mayaqua/Kernel.c:1199]: (style) Variable 'new_thread' is assigned a value that is never used.
[src/Mayaqua/Kernel.c:385]: (style) The function 'DelThreadFromThreadList' is never used.
[src/Mayaqua/Kernel.c:1726]: (style) The function 'GetCurrentLocale' is never used.
[src/Mayaqua/Kernel.c:562]: (style) The function 'GetHomeDir' is never used.
[src/Mayaqua/Kernel.c:1644]: (style) The function 'GetSpanStr' is never used.
[src/Mayaqua/Kernel.c:1695]: (style) The function 'GetSpanStrEx' is never used.
[src/Mayaqua/Kernel.c:950]: (style) The function 'GetTimeStr64' is never used.
[src/Mayaqua/Kernel.c:909]: (style) The function 'GetTimeStrEx64' is never used.
[src/Mayaqua/Kernel.c:1924]: (style) The function 'System64ToTime' is never used.
[src/Mayaqua/Kernel.c:1900]: (style) The function 'TimeToSystem64' is never used.
[src/Mayaqua/Kernel.c:470]: (style) The function 'WaitAllThreadsWillBeStopped' is never used.
[src/Mayaqua/Kernel.c:1478]: (style) The function 'GetTimeStr' is never used.
2018-09-01 10:25:09 +05:00
Ilya Shipitsin
a55a3b50e8 src/Mayaqua/Unix: remove unused code, improve readability of "ifdef"
refactoring was discussed in PR#672
2018-08-28 10:21:36 +05:00
Davide Beatrici
19e837d81e Unix.c: remove macOS-specific UnixGetTick64() implementation
clock_gettime() was implemented in macOS 10.12.
2018-08-24 06:43:45 +02:00
Ilya Shipitsin
ddd0c96d46 src/Mayaqua/Network.c: silence coverity on "Unchecked return value" 2018-08-23 13:36:38 +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
b398f09912 src/Mayaqua/Network: silence coverity, remove unused functions, variables
found by coverity, cppcheck

[src/Mayaqua/Network.c:10599] -> [src/Mayaqua/Network.c:10603]: (style) Variable 'ret' is reassigned a value before the old one has been used.
[src/Mayaqua/Network.c:10611] -> [src/Mayaqua/Network.c:10615]: (style) Variable 'e' is reassigned a value before the old one has been used.
[src/Mayaqua/Network.c:12979]: (style) Variable 'disable_conditional_accept' is assigned a value that is never used.
[src/Mayaqua/Network.c:12167]: (style) Variable 's' is assigned a value that is never used.
[src/Mayaqua/Network.c:12319]: (style) Variable 's' is assigned a value that is never used.
[src/Mayaqua/Network.c:20660]: (style) The function 'HttpSendInvalidHostname' is never used.
[src/Mayaqua/Network.c:6640]: (style) The function 'IsNetworkPrefixAddress6' is never used.
[src/Mayaqua/Network.c:17593]: (style) The function 'ParseIpAndSubnetMask6' is never used.
[src/Mayaqua/Network.c:473]: (style) The function 'SetNatTLowPriority' is never used.
[src/Mayaqua/Network.c:14924]: (style) The function 'SetSocketSendRecvBufferSize' is never used.
[src/Mayaqua/Network.c:6249]: (style) The function 'Win32AcceptCheckCallback_Delay' is never used.
[src/Mayaqua/Network.c:6264]: (style) The function 'Win32Accept_XP' is never used.
[src/Mayaqua/Network.c:7467]: (style) The function 'Win32GetTcpTableList' is never used.
[src/Mayaqua/Network.c:9171]: (style) The function 'Win32NetworkTest' is never used.
[src/Mayaqua/Network.c:6581]: (style) The function 'GetHostAddress6' is never used.
[src/Mayaqua/Network.c:7468]: (style) The function 'Win32GetTcpTableListByAllocateAndGetTcpExTableFromStack' is never used.
[src/Mayaqua/Network.c:7384]: (style) The function 'Win32GetTcpTableListByGetExtendedTcpTable' is never used.
[src/Mayaqua/Network.c:7515]: (style) The function 'Win32GetTcpTableListByGetTcpTable' is never used.
[src/Mayaqua/Network.c:6758]: (style) The function 'IPNot6' is never used.
2018-08-21 22:00:37 +05:00
Ilya Shipitsin
e0e4e8a4c8 src/Mayaqua/Unix: resolve "unchecked return value", remove unused functions,
variables. Found by coverity, cppcheck

[src/Mayaqua/Unix.c:2559]: (style) Unused variable: status
[src/Mayaqua/Unix.c:181]: (style) Redundant condition: select!=NULL. 'select==NULL || (select!=NULL && (*select)(entry))' is equivalent to 'select==NULL || (*select)(entry)'
[src/Mayaqua/Unix.c:1297]: (style) The function 'UnixDaemon' is never used.
[src/Mayaqua/Unix.c:543]: (style) The function 'UnixGetDiskFreeW' is never used.
[src/Mayaqua/Unix.c:834]: (style) The function 'UnixRestoreThreadPriority' is never used.
[src/Mayaqua/Unix.c:816]: (style) The function 'UnixSetThreadPriorityHigh' is never used.
[src/Mayaqua/Unix.c:825]: (style) The function 'UnixSetThreadPriorityIdle' is never used.
[src/Mayaqua/Unix.c:807]: (style) The function 'UnixSetThreadPriorityLow' is never used.
[src/Mayaqua/Unix.c:2805]: (style) The function 'UnixWaitProcess' is never used.
2018-08-21 11:05:31 +05:00
Davide Beatrici
daed1ad8b3
Merge PR #594: Remove SSLv3 support 2018-08-18 07:38:05 +02:00
Ilya Shipitsin
8ca0ce3efc src/Mayaqua/TcpIp: remove dead code, unused variables and fuctions
found by coverity, cppcheck

[src/Mayaqua/TcpIp.c:578]: (style) Variable 'tcp_size' is assigned a value that is never used.
[src/Mayaqua/TcpIp.c:1034]: (style) Variable 'has_vlan_tag' is assigned a value that is never used.
[src/Mayaqua/TcpIp.c:1996]: (style) Variable 'tcp_header_size' is assigned a value that is never used.
[src/Mayaqua/TcpIp.c:127]: (style) The function 'IcmpEchoSend' is never used.
[src/Mayaqua/TcpIp.c:2194]: (style) The function 'ParsePacketL2' is never used.
[src/Mayaqua/TcpIp.c:251]: (style) The function 'IcmpEchoSendBySocket' is never used.
2018-08-18 00:27:17 +05:00
Davide Beatrici
fc0bd44392
Merge PR #650: resolve several issues identified by coverity 2018-08-13 22:32:28 +02:00