1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-03-10 10:19:21 +03:00

Compare commits

...

54 Commits

Author SHA1 Message Date
cfe854b339 Merge pull request #2232 from synqa/add-tsan-suppression
Add ThreadSanitizer suppression file
2026-02-14 15:47:43 +01:00
c075bd85a8 Add ThreadSanitizer suppression file
Using no_sanitize("thread") disables instrumentation for the entire
stack frame, meaning functions called within that scope are also not
checked. By using race_top in a suppression file, we can suppress
erros only when they occur at the top of the stack. This provides more
granular control over errors suppression.
As an example, this suppression addresses #2222.
2026-02-14 22:42:48 +09:00
6f749ab71c Merge pull request #2181 from jgrasboeck/fix_openvpn_auth_failed_reply
Openvpn: only send AUTH_FAILED reply on auth errors
2026-02-14 11:06:26 +01:00
0e36e095f0 Merge pull request #2229 from chipitsine/master
ci: run coverity workflow on demand
2026-02-13 14:20:41 +01:00
34e4d4a54b ci: run coverity workflow on demand 2026-02-13 14:05:23 +01:00
df3ea19f0e Merge pull request #2226 from SaiXu-QC/WinArm64
Add Win Arm64 Doc
2026-02-09 08:42:27 +01:00
9da4aabda5 add win arm64 doc 2026-02-09 10:42:32 +08:00
3cb3dd20fc Add BUILD_WinArm64.md 2026-02-09 10:38:45 +08:00
b551b77e25 Merge pull request #2225 from synqa/tsan-disable-macro
Add macro to disable thread sanitizer
2026-02-08 17:26:26 +01:00
609b8f4a5e Merge pull request #2224 from synqa/revert-2221-fix-halt-flag
Revert "Fix data race on Tick64"
2026-02-08 17:25:04 +01:00
0a87ff8fbd Add macro to disable thread sanitizer
Define ATTRIBUTE_NO_TSAN as __attribute__((no_sanitize(\"thread\")))
when building with thread sanitizer enabled. Falls back to empty
definition when thread sanitizer is not active or not supported
compiler.
2026-02-08 23:41:10 +09:00
6016f84315 Revert "Fix data race on Tick64" 2026-02-08 23:14:09 +09:00
9d27b935b7 Merge pull request #2223 from synqa/fix-memory-leak-loadlanglist
Fix memory leak in LoadLangList()
2026-02-06 15:56:18 +01:00
1e1104d3ba Merge pull request #2221 from synqa/fix-halt-flag
Fix data race on Tick64
2026-02-06 15:55:01 +01:00
074efb5479 Merge pull request #2220 from synqa/fix-thread-counter
Fix race condition in thread counter
2026-02-06 15:54:18 +01:00
fe460de5a6 Fix data race on Tick64
Add lock protection when reading/writing Halt flag to prevent data race.
2026-02-06 21:12:16 +09:00
6ef941db21 Fix memory leak in LoadLangList() 2026-02-06 21:08:52 +09:00
d7d3ec8cac Fix race condition in thread counter
To prevent data races caused by concurrent access from multiple threads,
replace UINT with COUNTER.
2026-02-06 21:03:08 +09:00
68e9f0b593 Merge pull request #2218 from SoftEtherVPN/dependabot/npm_and_yarn/src/bin/hamcore/wwwroot/admin/default/webpack-5.105.0
Build(deps-dev): Bump webpack from 5.94.0 to 5.105.0 in /src/bin/hamcore/wwwroot/admin/default
2026-02-06 07:35:07 +01:00
f1012da5fb Build(deps-dev): Bump webpack in /src/bin/hamcore/wwwroot/admin/default
Bumps [webpack](https://github.com/webpack/webpack) from 5.94.0 to 5.105.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.94.0...v5.105.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.105.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 23:11:11 +00:00
1411d4ceb4 Merge pull request #2217 from synqa/fix-preserve-errno
Fix preserve errno in SIGCHLD signal handler
2026-02-05 15:46:13 +01:00
a3176175f9 Merge pull request #2216 from synqa/fix-ub-leftshift
Fix undefined behavior of left shift
2026-02-05 15:13:46 +01:00
88af7986b4 Fix preserve errno in SIGCHLD signal handler
Signal handler may interrupt code that depends on errno, and waitpid()
may modify errno, therefore, errno must be saved and restored before
returning.
2026-02-05 18:51:58 +09:00
38f102e2e7 Fix undefined behavior of left shift
Left shifting UCHAR promotes it to a signed integer. When the
value is >= 128 and shifted by 24, the result sets the sign bit,
causing undefined behavior. Fixes it by explicit casting to UINT.
2026-02-05 18:48:01 +09:00
e722f78608 Merge pull request #2209 from SaiXu-QC/WinArm64
Add Windows ARM64 support and ARM64 Neo6 driver
2026-02-03 11:46:26 +01:00
969812e0f2 add IS_CROSS_COMPILATION 2026-01-30 13:30:38 +08:00
14526cf3ea add arm64 DriverPackages/Neo6_Win10/arm64/Neo6_arm64_VPN.sys 2026-01-30 11:40:46 +08:00
875c4fa344 support ARM64 on windows 2026-01-30 11:36:39 +08:00
d8be1e4ddc Merge pull request #2205 from synqa/password-prompt-for-linux
Fix password input handling on Linux
2026-01-24 22:44:29 +01:00
eaef60a582 Fix password input handling on Linux
The password input handling on Linux to match the behavior on Windows.
It allows deleting characters using the Backspace, Delete, and
Left arrow keys, and correctly handles other input sequences are handling
correctly.
2026-01-24 12:37:43 +09:00
06c93414f2 Merge pull request #2204 from chipitsine/master
some translation guide kindly contributed by copilot
2026-01-23 21:42:12 +01:00
e065752618 some translation guide kindly contributed by copilot 2026-01-23 16:13:13 +01:00
d75aba9866 Merge pull request #2200 from synqa/fix-dangling-pointer
Fix dangling pointer
2026-01-18 21:39:56 +01:00
1b9ac396ba Fix dangling pointer
Previously, The address of a local stack variable was passed to a new
thread. Fix dangling pointer by switching to dynamic allocation.
This problem is also known as CVE-2025-25568.
2026-01-18 22:51:23 +09:00
041581ce30 Merge pull request #2193 from vamhund/turkish-translation
Add Turkish translation (strtable_tr.stb)
2026-01-09 14:19:09 +01:00
ca745bd234 Update language list file with Turkish entry 2026-01-09 15:36:54 +03:00
051da3a48f Add Turkish language entry to languages.txt 2026-01-09 15:34:31 +03:00
669f58036e Merge pull request #2195 from vamhund/fix-err137-logic
Fix logical contradiction in ERR_137
2026-01-08 17:14:07 +01:00
ce95ef93a2 Trigger Windows Build 2026-01-08 16:02:34 +03:00
355609b339 Fix logical contradiction in ERR_137
Fixed "too long" -> "too short" and "equal of" -> "equal or".

The first sentence says the name is "too long", but the second sentence says it must be "longer than 3 letters" (which implies it is currently too short).

The phrase "equal of longer than" should likely be "equal or longer than".
2026-01-08 15:42:58 +03:00
85c814a0fb Merge pull request #2194 from hiura2023/master
Fix: Correct the wrong data type passed to the log output function
2026-01-08 09:33:37 +01:00
90a77cfddf Merge branch 'SoftEtherVPN:master' into master 2026-01-08 16:52:52 +09:00
65e5e28549 Fix: Correct the wrong data type passed to the log output 2026-01-08 16:50:47 +09:00
770aef2866 Merge pull request #2192 from hiura2023/master
Fix: Kernel-mode NAT not available
2026-01-08 08:10:40 +01:00
b92294fc52 Fix: Kernel-mode NAT not available due to DHCP unfunctional 2026-01-08 13:27:10 +09:00
a4681818c4 Revert "Fix: Kernel-mode NAT not available"
This reverts commit d85fc71a3a.
2026-01-08 12:15:12 +09:00
0a44e995de Add Turkish translation (strtable_tr.stb) 2026-01-08 00:55:51 +03:00
d85fc71a3a Fix: Kernel-mode NAT not available 2026-01-05 23:28:10 +09:00
e884c4ef76 Merge pull request #2189 from SoftEtherVPN/dependabot/npm_and_yarn/src/bin/hamcore/wwwroot/admin/default/js-yaml-3.14.2
Bump js-yaml from 3.13.1 to 3.14.2 in /src/bin/hamcore/wwwroot/admin/default
2026-01-04 22:44:25 +01:00
859ff5ca5e Bump js-yaml in /src/bin/hamcore/wwwroot/admin/default
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.13.1 to 3.14.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-27 09:39:13 +00:00
85561f3584 Merge pull request #2188 from siddharth-narayan/macos-runner-update
Update macos runners
2025-12-27 10:37:49 +01:00
6880886e5a Update macos runners 2025-12-27 00:52:09 -05:00
d5c2e33175 Merge pull request #2184 from SoftEtherVPN/copilot/fix-false-positive-detection
Add comprehensive documentation for Microsoft Defender false positive detections
2025-12-06 19:01:47 +01:00
4a4c1c79de openvpn: only send AUTH_FAILED reply on auth errors 2025-11-26 13:53:14 +01:00
30 changed files with 9275 additions and 738 deletions

View File

@ -4,6 +4,7 @@ name: Coverity
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: read
@ -11,7 +12,7 @@ permissions:
jobs:
scan:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'SoftEtherVPN' }}
if: ${{ github.repository_owner == 'SoftEtherVPN' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v2
with:

View File

@ -7,7 +7,7 @@ jobs:
build_and_test:
strategy:
matrix:
os: [macos-15, macos-14, macos-13]
os: [macos-26, macos-15, macos-14]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:

View File

@ -136,6 +136,78 @@
"type": "STRING"
}
]
},
{
"name": "arm64-on-x64",
"description": "Cross compile Windows ARM64 on x64",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": ["msvc_arm64_x64"],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": [
{
"name": "BUILD_NUMBER",
"value": "${env.BuildNumber}",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Windows",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "arm64",
"type": "STRING"
},
{
"name": "CMAKE_C_COMPILER",
"value": "${env.VCINSTALLDIR}Tools/Llvm/bin/clang-cl.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "${env.VCINSTALLDIR}Tools/Llvm/bin/clang-cl.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_C_COMPILER_TARGET",
"value": "arm64-windows-msvc",
"type": "STRING"
},
{
"name": "CMAKE_CXX_COMPILER_TARGET",
"value": "arm64-windows-msvc",
"type": "STRING"
},
{
"name": "CMAKE_EXE_LINKER_FLAGS",
"value": "/machine:ARM64",
"type": "STRING"
},
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "arm64-windows-static",
"type": "STRING"
},
{
"name": "CMAKE_STATIC_LINKER_FLAGS",
"value": "/machine:ARM64",
"type": "STRING"
},
{
"name": "CMAKE_SHARED_LINKER_FLAGS",
"value": "/machine:ARM64",
"type": "STRING"
},
{
"name": "IS_CROSS_COMPILATION",
"value": "arm64-on-x64",
"type": "STRING"
}
]
}
]
}

View File

@ -293,6 +293,8 @@ We hope that you can reach one of the above URLs at least!
Your contribution to SoftEther VPN Project is much appreciated.
Please send patches to us through GitHub.
Here you find how to submit new translation: [TRANSLATION_GUIDE.md](TRANSLATION_GUIDE.md)
# DEAR SECURITY EXPERTS

BIN
TRANSLATION_GUIDE.md Normal file

Binary file not shown.

View File

@ -87,6 +87,10 @@ into it. So that is what will be described below.
- x86-on-x64
Cross compile x86 executables with 64-bit compiler
- arm64-on-x64
Cross compile arm64 executables with x64t compiler
On 64-bit Windows, all four configurations can be used. 32-bit platforms can only use 32-bit compiler.

52
src/BUILD_WinArm64.md Normal file
View File

@ -0,0 +1,52 @@
# How to build and install SoftEther VPN on Windows ARM64
This document describes how to build SoftEther VPN for Windows ARM64 and how to install the VPN Client and Neo6 virtual network adapter on Windows on ARM devices.
## Requirements
- Build host: Windows x64
- Target device: Windows 10 / Windows 11 ARM64
## Building
**Notes before building**: ARM64 builds are cross-compiled from an x64 Windows host. An existing x64-native build is required to generate hamcore.se2.
1. Follow [BUILD_WINDOWS.md](BUILD_WINDOWS.md##Building)
1. Build x64 (Native): From the build menu, select x64-on-x64. Complete the build successfully. This build is required to generate shared resources
1. Build ARM64 (Cross-Compiled): From the same build menu, select arm64-on-x64.
Build the ARM64 version of SoftEther VPN.
1. Building the Neo6 Virtual Network Adapter (ARM64)
Open the following project in Visual Studio:
```
.\src\Neo6\Neo6.vcxproj
```
SoftEther VPN Client uses the Neo6 virtual network adapter.
Driver Output Files
The ARM64 driver package includes:
```
Neo6_arm64_VPN.sys
Neo6_arm64_VPN.inf
```
Driver Signing and Installation (Windows ARM64)
```
Enable test-signing mode: bcdedit /set testsigning on
Reboot the system.
Testing signing:
Install the Neo6 ARM64 driver.
```
# Summary
SoftEther VPN can be cross-compiled for Windows ARM64 on an x64 host
VPN Client works natively on Windows on ARM
Neo6 ARM64 driver requires Microsoft signing for production use
Test-signing is suitable for local development only

View File

@ -1,4 +1,4 @@
if(UNIX)
if(UNIX)
# Creates wrapper scripts and installs them in the user's binaries directory, which is usually "/usr/local/bin".
# This is required because symlinks use the folder they are in as working directory.
#
@ -59,6 +59,12 @@ add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_S
include_directories(.)
if(WIN32)
if(IS_CROSS_COMPILATION MATCHES "arm64-on-x64")
set(CMAKE_SYSTEM_PROCESSOR "arm64")
else()
message("Setting QSPECTRE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qspectre")
endif()
add_definitions(-DWIN32 -D_WINDOWS -DOS_WIN32 -D_CRT_SECURE_NO_WARNINGS)
#
@ -69,9 +75,6 @@ if(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf /DYNAMICBASE")
message("Setting QSPECTRE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qspectre")
message("Setting CETCOMPAT")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /CETCOMPAT")
@ -164,15 +167,45 @@ add_custom_target(hamcore-archive-build
ALL
DEPENDS "${BUILD_DIRECTORY}/hamcore.se2"
)
if(IS_CROSS_COMPILATION MATCHES "arm64-on-x64")
file(TO_CMAKE_PATH "${TOP_DIRECTORY}" TOP_DIRECTORY_NORM)
set(X64_HAMCORE_BUILDER
"${TOP_DIRECTORY_NORM}/out/build/x64-native/src/hamcorebuilder/hamcorebuilder.exe"
)
if(EXISTS "${X64_HAMCORE_BUILDER}")
message(STATUS "file exist (from TOP_DIRECTORY)")
endif()
add_custom_command(
COMMENT "Building hamcore.se2 archive file..."
COMMAND hamcorebuilder "hamcore.se2" "${TOP_DIRECTORY}/src/bin/hamcore"
DEPENDS hamcorebuilder "${TOP_DIRECTORY}/src/bin/hamcore/"
OUTPUT "${BUILD_DIRECTORY}/hamcore.se2"
WORKING_DIRECTORY "${BUILD_DIRECTORY}"
VERBATIM
)
# support cross compile, when you compile ARM64 version on X64 Platform
if(EXISTS "${X64_HAMCORE_BUILDER}")
message("X64_HAMCORE_BUILDER found: ${X64_HAMCORE_BUILDER}")
elseif(EXISTS("${TOP_DIRECTORY}/out/build/x64-native/src/hamcorebuilder/hamcorebuilder.exe"))
set(X64_HAMCORE_BUILDER "${TOP_DIRECTORY}/out/build/x64-native/src/hamcorebuilder/hamcorebuilder.exe")
else()
message("${TOP_DIRECTORY}/out/build/x64-native/src/hamcorebuilder/hamcorebuilder.exe")
message(FATAL_ERROR "X64_HAMCORE_BUILDER not found: ${X64_HAMCORE_BUILDER}, pls build x64-native version first")
endif()
message(STATUS "X64_HAMCORE_BUILDER = ${X64_HAMCORE_BUILDER}")
add_custom_command(
COMMENT "Building hamcore.se2 archive file..."
COMMAND ${X64_HAMCORE_BUILDER} "hamcore.se2" "${TOP_DIRECTORY}/src/bin/hamcore"
DEPENDS ${X64_HAMCORE_BUILDER} "${TOP_DIRECTORY}/src/bin/hamcore/"
OUTPUT "${BUILD_DIRECTORY}/hamcore.se2"
WORKING_DIRECTORY "${BUILD_DIRECTORY}"
VERBATIM
)
else()
add_custom_command(
COMMENT "Building hamcore.se2 archive file..."
COMMAND hamcorebuilder "hamcore.se2" "${TOP_DIRECTORY}/src/bin/hamcore"
DEPENDS hamcorebuilder "${TOP_DIRECTORY}/src/bin/hamcore/"
OUTPUT "${BUILD_DIRECTORY}/hamcore.se2"
WORKING_DIRECTORY "${BUILD_DIRECTORY}"
VERBATIM
)
endif()
if(WIN32)
# PenCore

View File

@ -12,6 +12,15 @@ else()
add_library(cedar SHARED ${SOURCES_CEDAR} ${SOURCES_CEDAR_CPP} ${HEADERS_CEDAR})
endif()
if(MSVC)
target_compile_options(cedar PRIVATE /EHsc)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
target_compile_options(cedar PRIVATE /EHsc)
else()
target_compile_options(cedar PRIVATE -fexceptions)
endif()
endif()
set_target_properties(cedar
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
@ -22,19 +31,22 @@ set_target_properties(cedar
target_link_libraries(cedar PUBLIC mayaqua)
cmake_host_system_information(RESULT HAS_SSE2 QUERY HAS_SSE2)
set(BLAKE2_SRC_PATH $<IF:$<BOOL:${HAS_SSE2}>,${TOP_DIRECTORY}/3rdparty/BLAKE2/sse,${TOP_DIRECTORY}/3rdparty/BLAKE2/ref>)
set(BLAKE2_SRC $<IF:$<BOOL:${HAS_SSE2}>,${BLAKE2_SRC_PATH}/blake2s.c,${BLAKE2_SRC_PATH}/blake2s-ref.c>)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64|arm64v8|ARM64")
message(STATUS "Target architecture is ARM64")
set(BLAKE2_SRC_PATH "${TOP_DIRECTORY}/3rdparty/BLAKE2/neon")
set(BLAKE2_SRC "${BLAKE2_SRC_PATH}/blake2s-neon.c")
else()
set(BLAKE2_SRC_PATH $<IF:$<BOOL:${HAS_SSE2}>,${TOP_DIRECTORY}/3rdparty/BLAKE2/sse,${TOP_DIRECTORY}/3rdparty/BLAKE2/ref>)
set(BLAKE2_SRC $<IF:$<BOOL:${HAS_SSE2}>,${BLAKE2_SRC_PATH}/blake2s.c,${BLAKE2_SRC_PATH}/blake2s-ref.c>)
if(HAS_SSE2)
# If SSE2 is enabled, a build failure occurs with MSVC because it doesn't define "__SSE2__".
# The fix consists in defining "HAVE_SSE2" manually, effectively overriding the check.
set_property(SOURCE ${BLAKE2_SRC} PROPERTY COMPILE_DEFINITIONS "HAVE_SSE2")
endif()
endif()
target_include_directories(cedar PUBLIC ${BLAKE2_SRC_PATH})
target_sources(cedar PRIVATE ${BLAKE2_SRC})
if(HAS_SSE2)
# If SSE2 is enabled, a build failure occurs with MSVC because it doesn't define "__SSE2__".
# The fix consists in defining "HAVE_SSE2" manually, effectively overriding the check.
set_property(SOURCE ${BLAKE2_SRC} PROPERTY COMPILE_DEFINITIONS "HAVE_SSE2")
endif()
if(VCPKG_TARGET_TRIPLET)
find_package(unofficial-sodium CONFIG REQUIRED)
target_link_libraries(cedar PUBLIC unofficial-sodium::sodium)

View File

@ -99,6 +99,8 @@ void CheckNetworkAcceptThread(THREAD *thread, void *param)
Disconnect(s);
ReleaseSock(s);
Free(c);
}
@ -155,15 +157,15 @@ void CheckNetworkListenThread(THREAD *thread, void *param)
}
else
{
CHECK_NETWORK_2 c;
CHECK_NETWORK_2 *c;
THREAD *t;
Zero(&c, sizeof(c));
c.s = new_sock;
c.k = pri;
c.x = x;
c = ZeroMalloc(sizeof(CHECK_NETWORK_2));
c->s = new_sock;
c->k = pri;
c->x = x;
t = NewThread(CheckNetworkAcceptThread, &c);
t = NewThread(CheckNetworkAcceptThread, c);
Insert(o, t);
}
}

View File

@ -1938,6 +1938,7 @@ bool PasswordPrompt(char *password, UINT size)
c = _getch();
#else // OS_WIN32
c = getc(stdin);
PROCESS_CH:
#endif // OS_WIN32
if (c >= 0x20 && c <= 0x7E)
@ -1952,6 +1953,7 @@ bool PasswordPrompt(char *password, UINT size)
else if (c == 0x03)
{
// Break
RestoreConsole(console);
exit(0);
}
else if (c == 0x04 || c == 0x1a || c == 0x0D || c==0x0A)
@ -1977,7 +1979,47 @@ bool PasswordPrompt(char *password, UINT size)
goto BACKSPACE;
}
}
else if (c == 0x08)
#ifdef OS_UNIX // OS_UNIX
else if (c == 0x1B)
{
c = getc(stdin);
if (c != 0x5B && c != 0x4F)
{
// ESC key
goto PROCESS_CH;
}
c = getc(stdin);
if (c == 0x44)
{
// Left arrow key
goto BACKSPACE;
}
else if (c == 0x33)
{
c = getc(stdin);
if (c == 0x7E)
{
// Delete key
goto BACKSPACE;
}
}
// Drain remaining sequence bytes (most are <= 6)
for (int i = 0; i < 6; i++)
{
if (c >= 0x40 && c <= 0x7E)
{
// End of sequence
break;
}
c = getc(stdin);
}
continue;
}
#endif // OS_UNIX
else if (c == 0x08 || c == 0x7F)
{
BACKSPACE:
// Backspace

View File

@ -567,6 +567,9 @@ IPC *NewIPCBySock(CEDAR *cedar, SOCK *s, void *mac_address)
ipc->Sock = s;
AddRef(s->ref);
// Initialize to pass the validity check on the source IP address performed by IPCSendIPv4()
ZeroIP4(&ipc->ClientIPAddress);
Copy(ipc->MacAddress, mac_address, 6);
ipc->Interrupt = NewInterruptManager();

View File

@ -2562,9 +2562,16 @@ void OvsRecvPacket(OPENVPN_SERVER *s, LIST *recv_packet_list, UINT protocol)
Debug("OpenVPN Channel %u Failed.\n", j);
OvsLog(s, se, c, "LO_CHANNEL_FAILED");
// Return the AUTH_FAILED
str = "AUTH_FAILED";
WriteFifo(c->SslPipe->SslInOut->SendFifo, str, StrSize(str));
if ((se->IpcAsync->ErrorCode == ERR_AUTHTYPE_NOT_SUPPORTED) ||
(se->IpcAsync->ErrorCode == ERR_AUTH_FAILED) ||
(se->IpcAsync->ErrorCode == ERR_PROXY_AUTH_FAILED) ||
(se->IpcAsync->ErrorCode == ERR_USER_AUTHTYPE_NOT_PASSWORD) ||
(se->IpcAsync->ErrorCode == ERR_NOT_SUPPORTED_AUTH_ON_OPENSOURCE))
{
// Return the AUTH_FAILED
str = "AUTH_FAILED";
WriteFifo(c->SslPipe->SslInOut->SendFifo, str, StrSize(str));
}
s->SessionEstablishedCount++;

View File

@ -2815,6 +2815,7 @@ void NativeNatThread(THREAD *thread, void *param)
if (a != NULL)
{
char macstr[64];
IP dhcp_ip;
// Acquisition success
Debug("NnGetNextInterface Ok: %s\n", a->DeviceName);
@ -2842,9 +2843,10 @@ void NativeNatThread(THREAD *thread, void *param)
Debug("NnMainLoop Start.\n");
MacToStr(macstr, sizeof(macstr), a->Ipc->MacAddress);
UINTToIP(&dhcp_ip, a->CurrentDhcpOptionList.ServerAddress);
NLog(t->v, "LH_KERNEL_MODE_START", a->DeviceName,
&a->Ipc->ClientIPAddress, &a->Ipc->SubnetMask, &a->Ipc->DefaultGateway, &a->Ipc->BroadcastAddress,
macstr, &a->CurrentDhcpOptionList.ServerAddress, &a->DnsServerIP);
macstr, &dhcp_ip, &a->DnsServerIP);
NnMainLoop(t, a);
Debug("NnMainLoop End.\n");

View File

@ -4462,9 +4462,13 @@ bool IsAesNiSupported()
// Unfortunately OpenSSL doesn't provide a function to do it
#ifdef _MSC_VER
int regs[4]; // EAX, EBX, ECX, EDX
__cpuid(regs, 1);
supported = (regs[2] >> 25) & 1;
#if defined(_M_X64) || defined(_M_IX86)
int regs[4]; // EAX, EBX, ECX, EDX
__cpuid(regs, 1);
supported = (regs[2] >> 25) & 1;
#elif defined(_M_ARM64)
return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
#endif
#else // _MSC_VER
#if defined(CPU_FEATURES_ARCH_X86)
const X86Features features = GetX86Info().features;
@ -4757,7 +4761,7 @@ static void MY_SHA0_Transform(MY_SHA0_CTX* ctx) {
UCHAR* p = ctx->buf;
int t;
for(t = 0; t < 16; ++t) {
UINT tmp = *p++ << 24;
UINT tmp = (UINT)*p++ << 24;
tmp |= *p++ << 16;
tmp |= *p++ << 8;
tmp |= *p++;

View File

@ -63,7 +63,7 @@ static int ydays[] =
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
};
static UINT current_num_thread = 0;
static COUNTER *current_num_thread = NULL;
static UINT cached_number_of_cpus = 0;
@ -776,6 +776,7 @@ void InitThreading()
{
thread_pool = NewSk();
thread_count = NewCounter();
current_num_thread = NewCounter();
}
// Release of thread pool
@ -821,6 +822,9 @@ void FreeThreading()
DeleteCounter(thread_count);
thread_count = NULL;
DeleteCounter(current_num_thread);
current_num_thread = NULL;
}
// Thread pool procedure
@ -1028,9 +1032,9 @@ THREAD *NewThreadNamed(THREAD_PROC *thread_proc, void *param, char *name)
Wait(pd->InitFinishEvent, INFINITE);
current_num_thread++;
Inc(current_num_thread);
// Debug("current_num_thread = %u\n", current_num_thread);
// Debug("current_num_thread = %u\n", Count(current_num_thread));
return ret;
}
@ -1055,8 +1059,8 @@ void CleanupThread(THREAD *t)
Free(t);
current_num_thread--;
//Debug("current_num_thread = %u\n", current_num_thread);
Dec(current_num_thread);
//Debug("current_num_thread = %u\n", Count(current_num_thread));
}
// Release thread (pool)

View File

@ -72,11 +72,26 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow)
// Compiler dependent
#ifndef OS_WIN32
// Gcc compiler
// GCC or Clang compiler
#define GCC_PACKED __attribute__ ((__packed__))
// Clang compiler
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
#define ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
#endif // __has_feature(thread_sanitizer)
#endif // __has_feature
// GCC compiler
#if defined(__SANITIZE_THREAD__) && !defined(ATTRIBUTE_NO_TSAN)
#define ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
#endif // __SANITIZE_THREAD__
// Other or older Clang/GCC compiler
#ifndef ATTRIBUTE_NO_TSAN
#define ATTRIBUTE_NO_TSAN
#endif // ATTRIBUTE_NO_TSAN
#else // OS_WIN32
// VC++ compiler
#define GCC_PACKED
#define ATTRIBUTE_NO_TSAN
#endif // OS_WIN32
// Macro that displays the current file name and line number

View File

@ -470,6 +470,7 @@ LIST *LoadLangList()
b = ReadDump(filename);
if (b == NULL)
{
FreeLangList(o);
return NULL;
}

View File

@ -2140,9 +2140,13 @@ void UnixMemoryFree(void *addr)
// SIGCHLD handler
void UnixSigChldHandler(int sig)
{
int old_errno = errno;
// Recall the zombie processes
while (waitpid(-1, NULL, WNOHANG) > 0);
signal(SIGCHLD, UnixSigChldHandler);
errno = old_errno;
}
// Disable core dump

View File

@ -5,7 +5,8 @@
// NDIS6.c
// Windows NDIS 6.2 Routine
#include <GlobalConst.h>
//#include <GlobalConst.h>
#include "GlobalConst.h"
#define NEO_DEVICE_DRIVER

View File

@ -9,25 +9,37 @@
#define NDIS5_H
// Win32 DDK related
#ifndef CPU_64
#define _X86_
#else // CPU_64
#ifndef NEO_IA64
#define _AMD64_
#define AMD64
#else // NEO_IA64
#define _IA64_
#define IA64
#endif // NEO_IA64
#endif // CPU_64
#ifndef CPU_64
#define _X86_
#else // CPU_64
#ifdef CPU_ARM64
//#define _ARM64_
//#define ARM64
#elif defined(NEO_IA64)
#define _IA64_
#define IA64
#else
#define _AMD64_
#define AMD64
#endif
#endif // CPU_64
#define NDIS_MINIPORT_DRIVER
// NDIS 6.2
#define NDIS620_MINIPORT
#define NDIS_SUPPORT_NDIS61 1
#define NDIS_SUPPORT_NDIS620 1
#define NEO_NDIS_MAJOR_VERSION 6
#define NEO_NDIS_MINOR_VERSION 20
#define NDIS_WDM 1
#ifdef CPU_ARM64
#define NDIS640_MINIPORT
#define NDIS_MINIPORT_MINIMUM_MAJOR_VERSION 6
#define NDIS_MINIPORT_MINIMUM_MINOR_VERSION 40
#define NEO_NDIS_MAJOR_VERSION 6
#define NEO_NDIS_MINOR_VERSION 40
#else
// NDIS 6.2
#define NDIS620_MINIPORT
#define NDIS_SUPPORT_NDIS61 1
#define NDIS_SUPPORT_NDIS620 1
#define NEO_NDIS_MAJOR_VERSION 6
#define NEO_NDIS_MINOR_VERSION 20
#define NDIS_WDM 1
#endif
#include <wdm.h>
#include <ndis.h>

107
src/Neo6/Neo6.vcxproj Normal file
View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{F7679B65-2FEC-469A-8BAC-B07BF4439422}</ProjectGuid>
<RootNamespace>Neo6</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<TargetName>Neo6_arm64_unsigned</TargetName>
<TargetExt>.sys</TargetExt>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>17.0.36310.24</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<IntDir>$(Platform)_$(Configuration)\</IntDir>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Midl />
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<IntrinsicFunctions>false</IntrinsicFunctions>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>$(ProjectDir)\..\;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ARM64;_ARM64_;CPU_64;WIN32;CPU_ARM64;NDEBUG;_WINDOWS;_USRDLL;NEO_EXPORTS;VPN_SPEED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>false</StringPooling>
<ExceptionHandling>
</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StructMemberAlignment>8Bytes</StructMemberAlignment>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>false</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<!-- <PreLinkEvent>
<Command>$(SolutionDir)bin\BuildUtil.exe /CMD:GenerateVersionResource "$(TargetPath)" /OUT:"$(SolutionDir)tmp\VersionResources\$(ProjectName)_$(Platform).res" /PRODUCT:"SoftEther VPN"</Command>
</PreLinkEvent> -->
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Link>
<OutputFile>$(OutDir)Neo6_arm64_unsigned.sys</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ntoskrnl.lib;wdm.lib;hal.lib;;ucrt.lib;ndis.lib;wdmsec.lib;ntdll.lib;Kernel32.lib;fwpkclnt.lib;libcntpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- <ImportLibrary>$(SolutionDir)tmp\lib\$(Platform)_$(Configuration)\$(ProjectName).lib</ImportLibrary> -->
<TargetMachine>MachineARM64</TargetMachine>
</Link>
<!-- <PostBuildEvent>
<Command>$(SolutionDir)bin\BuildUtil.exe /CMD:SignCode "$(TargetPath)" /DEST:"$(TargetDir)Neo6_ARM64.sys" /COMMENT:"VPN Software" /KERNEL:yes /CERTID:0 /SHAMODE:0
$(SolutionDir)bin\BuildUtil.exe /CMD:SignCode "$(TargetPath)" /DEST:"$(TargetDir)Neo6_ARM64_win10.sys" /COMMENT:"VPN Software" /KERNEL:yes /CERTID:0 /SHAMODE:2
</Command>
</PostBuildEvent> -->
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="NDIS6.c" />
<ClCompile Include="Neo6.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="NDIS6.h" />
<ClInclude Include="Neo6.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Neo6.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,114 @@
; VPN Client Device Driver for Windows 2000 and Greater
;
; Copyright (c) SoftEther Corporation. All Rights Reserved.
; http://www.softether.co.jp/
;
; BUILD 9658
[Version]
Signature = "$Windows NT$"
Class = Net
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
Provider = %CompanyName%
DriverVer = 02/04/2018, 4.25.0.9658
CatalogFile.NT = Neo6_arm64_VPN.cat
[Manufacturer]
%CompanyName% = SoftEther, NTarm64
[SourceDisksNames]
1=%DiskDescription%, "", ,
[SourceDisksFiles]
Neo6_arm64_VPN.sys = 1
[DestinationDirs]
DefaultDestDir = 12
Neo.CopyFiles.Sys = 12
[Neo.CopyFiles.Sys]
Neo6_arm64_VPN.sys, , , 2
[SoftEther.NTarm64]
%NeoAdapter.DeviceDesc% = NeoAdapter.Install, NeoAdapter_VPN
[NeoAdapter.Install]
Characteristics = 0x1
AddReg = Neo.Reg, NeoAdapter.Ndi
CopyFiles = Neo.CopyFiles.Sys
*IfType = 53
*MediaType = 0
*PhysicalMediaType = 0
[NeoAdapter.Install.Services]
AddService = %Neo.Service.Name%, 2, Neo.Service, Neo.EventLog, , %Neo, EventLog.Name%
[NeoAdapter.Ndi]
HKR, , NetworkAddress, 0, %DefaultAddress%
HKR, Ndi, DeviceID, , "NeoAdapter_VPN"
HKR, , DevLoader, , ndis
HKR, , DeviceVxDs, , Neo6_arm64_VPN.sys
HKR, NDIS, LogDriverName, , "Neo_VPN"
HKR, NDIS, MajorNdisVersion, 1, 5
HKR, NDIS, MinorNdisVersion, 1, 0
HKR, Ndi\Interfaces, DefUpper, , "ndis5"
HKR, Ndi\Interfaces, UpperRange, , "ndis5"
HKR, Ndi\Interfaces, LowerRange, , "ethernet"
HKR, Ndi\Interfaces, DefLower, , "ethernet"
HKR, Ndi\Install, ndis5, , "Neo.CopyFiles.Sys"
HKR, Ndi\Params\NetworkAddress, ParamDesc, 0, %NetworkAddress%
HKR, Ndi\Params\NetworkAddress, type, 0, "edit"
HKR, Ndi\Params\NetworkAddress, LimitText, 0, "12"
HKR, Ndi\Params\NetworkAddress, UpperCase, 0, "1"
HKR, Ndi\Params\NetworkAddress, default, 0, %DefaultAddress%
HKR, Ndi\Params\NetworkAddress, optional, 0, "0"
HKR, Ndi\Params\MaxSpeed, ParamDesc, 0, %MaxSpeed%
HKR, Ndi\Params\MaxSpeed, type, 0, "int"
HKR, Ndi\Params\MaxSpeed, default, 0, "100"
HKR, Ndi\Params\MaxSpeed, min, 0, "0"
HKR, Ndi\Params\MaxSpeed, max, 0, "2000"
HKR, Ndi\Params\MaxSpeed, step, 0, "1"
HKR, Ndi\Params\MaxSpeed, Base, 0, "10"
HKR, Ndi\Params\KeepLink, ParamDesc, 0, %KeepLink%
HKR, Ndi\Params\KeepLink, type, 0, "enum"
HKR, Ndi\Params\KeepLink\enum, "1", 0, %On%
HKR, Ndi\Params\KeepLink\enum, "0", 0, %Off%
HKR, Ndi\Params\KeepLink, default, 0, "0"
[Neo.Service]
DisplayName = %Neo.Service.DispName%
Description = %Neo.Service.Desc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\Neo6_arm64_VPN.sys
LoadOrderGroup = NDIS
[Neo.Reg]
HKR, Ndi, Service, 0, Neo.Service.Name
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
[Neo.EventLog]
HKR, , EventMessageFile, 0x00020000, "%11%\IoLogMsg.dll;%12%\Neo6_arm64_VPN.sys"
HKR, , TypesSupported, 0x00010001, 7
[Strings]
CompanyName = "SoftEther Corporation"
DiskDescription = "VPN Client Device Driver Install Disk"
Neo.Service.Name = "Neo_VPN"
Neo.Service.DispName = "VPN Client Device Driver - VPN"
Neo.Service.Desc = "VPN Client Adapter - VPN"
NeoAdapter.DeviceDesc = "VPN Client Adapter - VPN"
Neo.EventLog.Name = "Neo"
NetworkAddress = "MAC Address"
DefaultAddress = "000001000001"
MaxSpeed = "Indicate Speed (Mbps)"
KeepLink = "Keep Link"
On = "On"
Off = "Off"
; Auto Generated 20180205_163621.454

View File

@ -10,3 +10,4 @@
5 ru Russian Русский 1049 ru
6 pt_br Portuguese-Brazil Português-Brasil 1046 pt_br
7 id Indonesian Bahasa 1057 id
8 tr Turkish Türkçe 1055 tr

View File

@ -3,4 +3,4 @@
# 番号 識別子 英語表記 ローカル表記 Windowsロケール番号 UNIXロケール文字一覧
1 en English English 1033 en,us,c
8 tr Turkish Türkçe 1055 tr

View File

@ -200,7 +200,7 @@ ERR_133 The specified Dynamic DNS hostname is already used. Please change th
ERR_134 The specified Dynamic DNS hostname has an invalid characters. Please change the hostname.
ERR_135 The length of the specified Dynamic DNS hostname is too long. A hostname must be equal or shorter than 31 letters.
ERR_136 The Dynamic DNS hostname is not specified.
ERR_137 The length of the specified Dynamic DNS hostname is too long. A hostname must be equal of longer than 3 letters.
ERR_137 The length of the specified Dynamic DNS hostname is too short. A hostname must be equal or longer than 3 letters.
ERR_138 The password of the specified user in the Virtual Hub must be reset before using MS-CHAP v2 authentication. Please ask the administrator of the VPN Server to reset the password by the VPN Server Manager or vpncmd which internal version is 4.0 or greater. Or you can change the password with VPN Client by yourself.
ERR_139 The connection to the Dynamic DNS server has been disconnected.
ERR_140 Failed to initialize the ICMP (Ping) protocol. The process of the VPN Server might be running in a normal-user privileges. In such case, run the VPN Server as a system service. (in Linux / UNIX, run it in root privileges.)
@ -7422,3 +7422,4 @@ SW_LINK_NAME_LANGUAGE_COMMENT Change the display language setting of %s.
SW_LINK_NAME_DEBUG Debugging Information Collecting Tool
SW_LINK_NAME_DEBUG_COMMENT Collects debugging information of SoftEther VPN. Use this tool only if your support staff asks you to do so.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

12
tsan_suppressions.txt Normal file
View File

@ -0,0 +1,12 @@
# This file contains suppressions for Thread Sanitizer.
# For the specification, refer to: https://github.com/google/sanitizers/wiki/threadsanitizersuppressions
# Thread Sanitizer reports data races on Finished and NoDelayFlag in CONNECT_SERIAL_PARAM,
# shared between BindConnectThreadForIPv4, BindConnectThreadForIPv6, and BindConnectEx5.
# These are benign data races: the Set/Wait on FinishEvent provides synchronization
# equivalent to a lock, but TSan cannot recognize it.
# https://github.com/SoftEtherVPN/SoftEtherVPN/pull/2222
race_top:BindConnectThreadForIPv4
race_top:BindConnectThreadForIPv6
race_top:BindConnectEx5