1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-11-20 18:31:51 +03:00

14 Commits

Author SHA1 Message Date
acbc514b87 Merge pull request #2170 from kanglongwei/branch2
fix: #2166 L3KnownArp, delete entry from the incorrect list
2025-10-28 21:44:25 +01:00
d9d78a0b2c Merge pull request #2171 from chipitsine/master
CI: modernize freebsd image
2025-10-25 11:26:11 +02:00
1373ed4c6c CI: modernize freebsd image 2025-10-25 10:08:15 +02:00
ffe9ade675 Merge pull request #2169 from kanglongwei/branch1
fix: #2165 memory leak
2025-10-13 14:13:55 +02:00
ab245552b1 fix: #2165 memory leak 2025-10-13 20:05:28 +08:00
fdcb0a207b fix: #2166 L3KnownArp, delete entry from the incorrect list 2025-10-10 21:20:30 +08:00
564d2f84b4 Merge pull request #2163 from martinetd/disable_oqs
Mayaqua build: allow disabling OQS
2025-10-01 11:27:06 +02:00
4bb366572d Mayaqua build: allow disabling OQS
SoftEtherVPN version 5.02.5186 enable post-quantum algorithms, but these
come at a large size increase (after strip, on x86_64, with default
options as of master):
- default options: 9.1M
- new -DOQS_ENABLE=OFF: 762K

Note it is also possible to disable all the algorithms individually by
passing the (243!) options to cmake -DOQS_ENABLE_KEM_BIKE=OFF
-DOQS_ENABLE_KEM_FRODOKEM=OFF -DOQS_ENABLE_KEM_NTRUPRIME=OFF ...,
in which case the binary goes back to a reasonable size of 830K

In the future, it might make sense to add a few settings picking
"sensible" algorithms, e.g. allow everything for a server build or only
allow the best algorithms for a lightweight client.

See: #2148
2025-10-01 18:05:59 +09:00
6c04825b46 Merge pull request #2157 from chipitsine/1ce88cea-29e8-466a-88f4-3713e94171d8
docker: smoke test image during generating
2025-09-06 16:31:04 +02:00
0ec8a1ed54 docker: smoke test image during generating
reference: https://github.com/SoftEtherVPN/SoftetherVPN-docker/issues/17
2025-09-05 21:22:43 +02:00
2acefef41e Merge pull request #2156 from metalefty/fix_cpu_features
Proper fix for #2122 #2150
2025-09-05 19:43:42 +02:00
efb04daa34 Proper fix for #2122 #2150
Bundled cpu_features needs to be built with PIC but SHARED_LIBS should
be OFF.
2025-09-05 22:40:18 +09:00
c399ce6bbe Merge pull request #2152 from metalefty/cpu_features_pic
Build bundled cpu_features with PIC
2025-08-25 15:36:27 +02:00
2746e8dd19 Build bundled cpu_features with PIC
After updating bundled cpu_features to 0.9.0, set_property() is not
effective. We need to use set() instead.

Resolves: #2122 #2150
2025-08-25 21:52:15 +09:00
5 changed files with 21 additions and 9 deletions

View File

@ -4,14 +4,14 @@ FreeBSD_task:
SSL: openssl SSL: openssl
OPENSSL_ROOT_DIR: /usr/local OPENSSL_ROOT_DIR: /usr/local
env: env:
SSL: openssl32 SSL: openssl36
OPENSSL_ROOT_DIR: /usr/local OPENSSL_ROOT_DIR: /usr/local
env: env:
# base openssl # base openssl
SSL: SSL:
matrix: matrix:
freebsd_instance: freebsd_instance:
image_family: freebsd-14-2 image_family: freebsd-14-3
prepare_script: prepare_script:
- pkg install -y pkgconf cmake git libsodium cpu_features $SSL - pkg install -y pkgconf cmake git libsodium cpu_features $SSL
- git submodule update --init --recursive - git submodule update --init --recursive

View File

@ -37,15 +37,18 @@ COPY --from=builder /usr/local/src/SoftEtherVPN/build/libcedar.so /usr/local/src
FROM base AS vpnserver FROM base AS vpnserver
COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnserver ./ COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnserver ./
RUN ./vpnserver --help
EXPOSE 443/tcp 992/tcp 1194/tcp 1194/udp 5555/tcp 500/udp 4500/udp EXPOSE 443/tcp 992/tcp 1194/tcp 1194/udp 5555/tcp 500/udp 4500/udp
CMD ["/usr/local/bin/vpnserver", "execsvc"] CMD ["/usr/local/bin/vpnserver", "execsvc"]
FROM base AS vpnclient FROM base AS vpnclient
COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnclient ./ COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnclient ./
RUN ./vpnclient --help
CMD ["/usr/local/bin/vpnclient", "execsvc"] CMD ["/usr/local/bin/vpnclient", "execsvc"]
FROM base AS vpnbridge FROM base AS vpnbridge
COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnbridge ./ COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnbridge ./
RUN ./vpnbridge --help
CMD ["/usr/local/bin/vpnbridge", "execsvc"] CMD ["/usr/local/bin/vpnbridge", "execsvc"]

View File

@ -457,10 +457,10 @@ void L3KnownArp(L3IF *f, UINT ip, UCHAR *mac)
// Delete an ARP query entry to this IP address // Delete an ARP query entry to this IP address
Zero(&t, sizeof(t)); Zero(&t, sizeof(t));
t.IpAddress = ip; t.IpAddress = ip;
w = Search(f->IpWaitList, &t); w = Search(f->ArpWaitTable, &t);
if (w != NULL) if (w != NULL)
{ {
Delete(f->IpWaitList, w); Delete(f->ArpWaitTable, w);
Free(w); Free(w);
} }

View File

@ -5843,7 +5843,6 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
// Target is invalid // Target is invalid
HttpSendNotFound(s, h->Target); HttpSendNotFound(s, h->Target);
Free(data); Free(data);
FreeHttpHeader(h);
*error_detail_str = "POST_Target_Wrong"; *error_detail_str = "POST_Target_Wrong";
} }
else else
@ -5861,10 +5860,10 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
{ {
// WaterMark is incorrect // WaterMark is incorrect
HttpSendForbidden(s, h->Target, NULL); HttpSendForbidden(s, h->Target, NULL);
FreeHttpHeader(h);
*error_detail_str = "POST_WaterMark_Error"; *error_detail_str = "POST_WaterMark_Error";
} }
} }
FreeHttpHeader(h);
} }
else if (StrCmpi(h->Method, "OPTIONS") == 0) else if (StrCmpi(h->Method, "OPTIONS") == 0)
{ {
@ -5884,6 +5883,7 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
continue; continue;
} }
} }
FreeHttpHeader(h);
} }
else if (StrCmpi(h->Method, "SSTP_DUPLEX_POST") == 0 && (ProtoEnabled(server->Proto, "SSTP") || s->IsReverseAcceptedSocket) && GetServerCapsBool(server, "b_support_sstp")) else if (StrCmpi(h->Method, "SSTP_DUPLEX_POST") == 0 && (ProtoEnabled(server->Proto, "SSTP") || s->IsReverseAcceptedSocket) && GetServerCapsBool(server, "b_support_sstp"))
{ {

View File

@ -18,9 +18,14 @@ set_target_properties(mayaqua
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
if(OPENSSL_VERSION VERSION_LESS "3") # Disable oqsprovider when OpenSSL version < 3 if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3")
add_definitions(-DSKIP_OQS_PROVIDER) set(OQS_ENABLE ON CACHE BOOL "By setting this to OFF, Open Quantum Safe algorithms will not be built in")
else() else()
# Disable oqsprovider when OpenSSL version < 3
set(OQS_ENABLE OFF)
endif()
if(OQS_ENABLE)
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)") set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.") set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.")
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared) set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
@ -32,6 +37,8 @@ else()
target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include) target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(mayaqua PRIVATE oqsprovider) target_link_libraries(mayaqua PRIVATE oqsprovider)
else()
add_definitions(-DSKIP_OQS_PROVIDER)
endif() endif()
include(CheckSymbolExists) include(CheckSymbolExists)
@ -125,8 +132,10 @@ if(UNIX)
message("-- Using system's cpu_features") message("-- Using system's cpu_features")
target_link_libraries(mayaqua PRIVATE cpu_features) target_link_libraries(mayaqua PRIVATE cpu_features)
else() else()
message("-- Using bundled cpu_features")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(3rdparty/cpu_features) add_subdirectory(3rdparty/cpu_features)
set_property(TARGET cpu_features PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(mayaqua PRIVATE cpu_features) target_link_libraries(mayaqua PRIVATE cpu_features)
endif() endif()