100 Commits
Author SHA1 Message Date
Davide Beatrici 6a170ac691 Merge PR #1911: Fix 7 vulnerabilities, add softether.net after-2038 year certificate hash, add vpncmd message about Developer Edition 2023-10-09 18:01:47 +02:00
Davide Beatrici eb785e08fe Merge PR #1866: Translate GenX25519/GetPublicX25519 command 2023-07-05 09:55:53 +02:00
Davide Beatrici 1493ccb44d Merge PR #1865: Fix build when NO_VLAN 2023-07-05 09:55:35 +02:00
Davide Beatrici 5633314981 Merge PR #1868: Fix build on __FreeBSD_version >= 140091 (LLVM 16) 2023-07-04 06:08:21 +02:00
Davide Beatrici 1c0bdb0c30 Merge PR #1860: Cedar/VLanUnix: add description to FreeBSD tap device 2023-06-08 19:09:02 +02:00
Davide Beatrici 0f689d9dfc Merge PR #1859: FreeBSD: Improve client's virtual network interface handling 2023-06-01 09:38:26 +02:00
Davide Beatrici 23c3e1d9e5 README.md: Update OneDev URL
https://code.onedev.io/onedev/server/~issues/458
2022-11-29 02:08:17 +01:00
Davide Beatrici dca2eaa370 Merge PR #1707: FreeBSD CI: Add test with OpenSSL 3.0.x 2022-11-22 19:33:27 +01:00
Davide Beatrici e85fc4435e README.md: Replace Codeberg with OneDev, update GitLab URL 2022-08-07 23:23:57 +02:00
Davide Beatrici cf38a3b6c2 Merge PR #1641: fix typo of disclaimers 2022-08-03 19:39:41 +02:00
Davide Beatrici a14d812dcb Merge PR #1610: Proto_OpenVPN: Set max allowed ACKs to 8 for P_ACK_V1 2022-06-14 04:53:56 +02:00
Davide Beatrici 0d075f0b42 Merge PR #1592: Fix invalid systemd TasksMax 2022-05-11 20:21:58 +02:00
Davide Beatrici bf206bd7ad Merge PR #1589: Fix static route pushing to OpenVPN clients 2022-05-10 21:09:19 +02:00
Davide Beatrici 2f1bff96b2 Merge PR #1587: Implement additional option for PrivacyFilter Mode settings 2022-05-09 20:21:23 +02:00
Davide Beatrici c6334a44f9 Merge PR #1561: Bump tar from 4.4.8 to 4.4.19 2022-03-20 20:10:43 +01:00
Davide Beatrici 9764485774 Merge PR #1551: Bump ajv from 6.10.0 to 6.12.6 2022-03-19 20:16:53 +01:00
Davide Beatrici a52a3928db Merge PR #1556: Fix wrong endianness in InRpcNodeInfo() and OutRpcNodeInfo() 2022-02-22 19:47:09 +01:00
Davide Beatrici 10b5034f0d FUNDING.yml: Remove Bountysource link 2022-01-03 03:17:56 +01:00
Davide Beatrici 2955dc5580 Merge PR #1507: Change default hub option to allow default router in IPv6 RA 2021-11-24 00:22:04 +01:00
Davide Beatrici 235d5d1d0d Merge PR #1506: Cedar/Proto_PPP: Fix IPC DHCP renewal 2021-11-24 00:20:37 +01:00
Davide Beatrici d7be057ae0 Merge PR #1489: Fix policy dialog and memory overrun 2021-09-30 21:23:17 +02:00
Davide Beatrici 6e7eba8e71 Merge PR #1486: Fix auto refreshing of client manager 2021-09-28 22:01:19 +02:00
Davide Beatrici 4657d7ee49 Merge PR #1484: Password change from client increments config file revision 2021-09-22 00:28:32 +02:00
Davide Beatrici a56cfac947 Merge PR #1482: Cedar/Protocol.c: Fix connection to server clusters 2021-09-18 10:34:20 +02:00
Davide Beatrici f74c53b449 Merge PR #1480: CI: gitlab: remove broken tasks, leave only Illumos 2021-09-08 23:03:16 +02:00
Davide Beatrici 26c8fbe538 Merge PR #1476: openvpn live tests: change "remote" inplace 2021-08-30 08:16:50 +02:00
Davide Beatrici 3cc85c1d51 Merge PR #1474: enable Control-flow Enforcement Technology (CET) Shadow Stack mitigation 2021-08-27 21:06:08 +02:00
Davide Beatrici 224abd99b8 Merge PR #1472: Enable Control flow guard and Qspectre protection for windows binaries 2021-08-27 06:45:51 +02:00
Davide Beatrici d0fe38384c Merge PR #1471: CI: Azure Pipelines: enable submodules checkout 2021-08-26 19:40:40 +02:00
Davide Beatrici 7f8e527883 CMake: Fix BLAKE2 build failure with MSVC due to it not defining __SSE2__ 2021-08-10 22:58:28 +02:00
Davide Beatrici 832c69add2 Merge PR #1449: CMake: Add build time check for EVP_PKEY_get_raw_public_key() availability 2021-08-09 04:41:54 +02:00
Davide Beatrici ffc095f95a CMake: Add build time check for EVP_PKEY_get_raw_public_key() availability
We need the function since 9dbbfcd388, but unfortunately it's not provided by LibreSSL.

By introducing a build time check we inform the user about the issue explicitly instead of just letting compilation fail.
2021-08-08 19:29:32 +02:00
Davide Beatrici 97a04888b7 Merge PR #1445: src/Cedar/SW.c: treat "0" build as legitimate 2021-08-01 12:42:43 +02:00
Davide Beatrici 101d79d7c3 Merge PR #1441: Mayaqua/Network.c: Fix race condition in TUBE operation 2021-07-23 19:42:13 +02:00
Davide Beatrici bf14817f1f Merge PR #1434: Cedar/Proto_PPP.c: Fix memory leak in EAP-MSCHAPv2 2021-07-21 23:54:59 +02:00
Davide Beatrici 996f2f2aa0 Merge PR #1427: Cedar/IPC.c: Add hub release in NewIPC() 2021-07-12 23:20:53 +02:00
Davide Beatrici 26a27553b2 Merge PR #1426: Mayaqua/Network.c: Create UDP listener for every interface if ListenIP is wildcard 2021-07-11 21:35:01 +02:00
Davide Beatrici a2f30c8aad Merge PR #1417: Mayaqua/Network.c: Fix L2TP/IPsec over IPv6 when listening on :: 2021-07-07 20:31:49 +02:00
Davide Beatrici c310163244 Cedar/Command: Add GenX25519 and GetPublicX25519 commands
GenX25519 command - Create new X25519 keypair
Help for command "GenX25519"

Purpose:
  Create new X25519 keypair

Description:
  Use this to create a new X25519 keypair, which can be used for WireGuard.
  Both the private and public key will be shown.
  The public key can be shared and is used to identify a peer.
  Also, it can always be retrieved from the private key using the GetPublicX25519 command.
  The private key should be kept in a secure place and never be shared.
  It cannot be recovered once lost.

Usage:
  GenX25519

==========================================================================================

GetPublicX25519 command - Retrieve public X25519 key from a private one
Help for command "GetPublicX25519"

Purpose:
  Retrieve public X25519 key from a private one

Description:
  Use this if you have a private X25519 key and want to get its corresponding public key.

Usage:
  GetPublicX25519 [private]

Parameters:
  private - The private X25519 key you want to get the corresponding public key of.
2021-07-07 08:43:41 +02:00
Davide Beatrici 9dbbfcd388 Mayaqua: Add new cryptographic functions for X25519/X448 keys management
The files are created in a new folder to keep the source tree tidier.

Please note that only X25519/X448 keys are supported due to an OpenSSL limitation:
https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_new.html

We have functions that handle AES keys in Encrypt.c/.h.
Ideally we should move them into the new files.
2021-07-07 08:11:08 +02:00
Davide Beatrici 4328e6e5ab CMake: Link Cedar to Mayaqua directly
It's Cedar itself that depends on Mayaqua, not the executables.
2021-07-07 08:08:12 +02:00
Davide Beatrici 505c854303 Merge PR #1414: Mayaqua/Network.c: Use int as boolean flags for socket options 2021-07-07 06:35:50 +02:00
Davide Beatrici 513ad6e792 Merge PR #1410: Mayaqua/DNS.c: Fix DNS resolution in dual stack environment 2021-07-05 20:23:09 +02:00
Davide Beatrici 0d5b05ef02 Merge PR #1411: Cedar/Protocol.c: Use real server IP in creating node info under direct mode 2021-07-05 20:15:29 +02:00
Davide Beatrici 4eae5820f6 Merge PR #1407: Cedar/Connection.c: Fix buffer overflow when inserting NAT-T information 2021-07-04 08:45:27 +02:00
Davide Beatrici dc296f1eff Merge PR #1406: Add WireGuard mention to README.md 2021-07-03 23:16:31 +02:00
Davide Beatrici 233e28f38c Refactor Base64 functions, encode/decode using OpenSSL's EVP interface
Our own implementation works fine, however we should use OpenSSL's one since we already link to the library.

Base64Decode() and Base64Encode() return the required buffer size when "dst" is NULL.

This allows to efficiently allocate a buffer, without wasting memory or risking an overflow.

Base64FromBin() and Base64ToBin() perform all steps, returning a heap-allocated buffer with the data in it.
2021-07-02 09:24:41 +02:00
Davide Beatrici 46ca5f7b98 Use "%S" instead of "%s" for LA_SET_PORTS_UDP and LA_SET_PROTO_OPTIONS
Turns out %S refers to ANSI/UTF-8 and %s to UTF-16.

This commit fixes a buffer overflow reported by AddressSanitizer and removes an unnecessary conversion to UTF-16.
2021-06-27 21:08:26 +02:00
Davide Beatrici 4221579e95 Remove obsolete hardcoded build number checks
The open-source project began with version 1.00, build 9022.

With the exception of an informative message fallback for builds older than 9428 (2014), all checks were for closed-source builds.
2021-06-27 07:21:06 +02:00
Davide Beatrici 56bb573b17 Merge PR #1395: Add warning about build number, initialize to 5180 2021-06-24 10:28:36 +02:00
Davide Beatrici 43a80702a9 Merge PR #1376: Cedar/Proto_PPP: Fix EAP-TLS fragmentation 2021-06-19 02:00:24 +02:00
Davide Beatrici ad139a7cbb Merge PR #1374: add missing libsodium dependency to coverity pipeline 2021-06-16 21:44:44 +02:00
Davide Beatrici 214992c232 Merge PR #1371: add github workflow to create release tarball with submodules 2021-06-14 05:49:30 +02:00
Davide Beatrici f18837b491 Merge PR #1367: hamcore(ja): just adding a missing ":" 2021-06-11 06:05:46 +02:00
Davide Beatrici 5f76dbcfa2 Merge PR #1362: Japanese translation: WireGuard and some new messages 2021-06-06 22:16:58 +02:00
Davide Beatrici 2262b8a160 Merge PR #1354: Mayaqua/FileIO: Fix typo causing segmentation fault on Hamcore cache expiration 2021-05-26 21:14:59 +02:00
Davide Beatrici 2923b5500a Mayaqua/FileIO: Fix typo causing segmentation fault on Hamcore cache expiration 2021-05-26 20:46:21 +02:00
Davide Beatrici 7acd52d724 Merge PR #1352: Cedar/Proto_PPP: Fix EAP identifier duplication 2021-05-26 20:29:55 +02:00
Davide Beatrici dc8d705854 Merge PR #1351: Read hamcore.se2 using libhamcore, set arbitrary path through HAMCORE_FILE_PATH 2021-05-26 08:42:52 +02:00
Davide Beatrici 81c71d309a Read hamcore.se2 using libhamcore, set arbitrary path through HAMCORE_FILE_PATH 2021-05-26 07:44:45 +02:00
Davide Beatrici e0182ca3d9 src: Update "libhamcore" submodule 2021-05-26 04:18:08 +02:00
Davide Beatrici 97d9761a9b Bump version to 5.02 2021-05-25 01:29:36 +02:00
Davide Beatrici 544c9a73da Merge PR #1343: Fix IPv6 Neighbor Discovery for PPP based protocols 2021-05-09 19:59:34 +02:00
Davide Beatrici 2f801f30de Fix compile errors on OpenBSD
- <pthread.h> included for the "pthread_t" type definition.
- <net/ethernet.h> include removed as the header doesn't exist.
- AI_ALL and AI_V4MAPPED defined to 0 as the options don't exist.
2021-05-03 19:58:12 +02:00
Davide Beatrici ce54531b53 FUNDING.yml: Add Liberapay link 2021-04-25 06:53:39 +02:00
Davide Beatrici 285e322171 Merge PR #1337: Cedar/IPC: Fix MAC address for IPv4 multicast 2021-04-24 04:01:58 +02:00
Davide Beatrici 3a595b4a46 Mayaqua/DNS.c: Fix memory leaks
52 bytes in 2 blocks are definitely lost in loss record 5 of 13
   at 0x483877F: malloc (vg_replace_malloc.c:307)
   by 0x4ABB1BB: UnixMemoryAlloc (Unix.c:2033)
   by 0x4A7FABF: InternalMalloc (Memory.c:3819)
   by 0x4A7B769: MallocEx (Memory.c:3650)
   by 0x4A7B769: Malloc (Memory.c:3641)
   by 0x4AA71A9: CopyStr (Str.c:1884)
   by 0x4A61A9C: DnsCacheReverseUpdate (DNS.c:257)
   by 0x4A62123: DnsResolveReverse (DNS.c:506)
   by 0x4A93EB3: GetHostName (Network.c:15023)
   by 0x4A93EB3: AcceptInitEx (Network.c:12589)
   by 0x4934659: TCPAcceptedThread (Listener.c:172)
   by 0x4A76469: ThreadPoolProc (Kernel.c:872)
   by 0x4ABD159: UnixDefaultThreadProc (Unix.c:1589)
   by 0x51C2EA6: start_thread (pthread_create.c:477)

2,280 (684 direct, 1,596 indirect) bytes in 9 blocks are definitely lost in loss record 11 of 13
   at 0x483877F: malloc (vg_replace_malloc.c:307)
   by 0x4C65AC5: gaih_inet.constprop.0 (getaddrinfo.c:1058)
   by 0x4C67224: getaddrinfo (getaddrinfo.c:2256)
   by 0x4A61E06: DnsResolver (DNS.c:404)
   by 0x4A76469: ThreadPoolProc (Kernel.c:872)
   by 0x4ABD159: UnixDefaultThreadProc (Unix.c:1589)
   by 0x51C2EA6: start_thread (pthread_create.c:477)
   by 0x4C7CDEE: clone (clone.S:95)
2021-04-21 22:35:45 +02:00
Davide Beatrici 76395d8f8d Merge PR #497: Cedar: Make OpenVPN timeout and ping transmission interval configurable 2021-04-21 22:01:15 +02:00
Davide Beatrici 2aaf9012a0 Cedar/Proto_OpenVPN: Make timeout and ping transmission interval configurable
Also, the default timeout value is set to 30000 (milliseconds) instead of 10000.

The change is made because it was reported that some routers failed to connect in time.
2021-04-21 08:29:30 +02:00
Davide Beatrici 4b05de1a93 Cedar: Add support for 32 bit unsigned integer Proto options
This commit also fixes a bug which caused the server to initialize all boolean options to false.

It was caused by SiLoadProtoCfg() not checking whether the item exists in the configuration file.

CfgGetBool() always returns false if the item doesn't exist.
2021-04-21 08:12:45 +02:00
Davide Beatrici 6f050f2b01 README.md: Add Codeberg to mirror list 2021-04-21 04:00:03 +02:00
Davide Beatrici 0472f9c286 Rewrite DNS API from scratch into dedicated file(s)
From a functional point of view, the main improvement is that GetIP() now always prioritizes IPv6 over IPv4.
The previous implementation always returned an IPv4 address, unless not available: in such case it failed.
This means that now connections to hostnames should be established via IPv6 if available.

From a programmer point of view, getting rid of the insane wrappers is enough to justify a complete rewrite.

As an extra, several unrelated unused global variables are removed.
2021-04-18 01:46:59 +02:00
Davide Beatrici bad9310aa4 Merge PR #1324: Cedar: Make use of IP address reported by NAT-T server for UDP acceleration 2021-04-14 20:45:41 +02:00
Davide Beatricianddomosekai d4d15b66d3 Cedar: Make use of IP address reported by NAT-T server for UDP acceleration
Before this commit, the IP address reported by the NAT-T server was immediately discarded.
That's because the peer should be accessible via the IP address used to establish the TCP connection.

User "domosekai" (https://www.domosekai.com) pointed out that the NAT-T IP address should be taken into account.
In his case it's required due to his broadband carrier's NAT causing TCP and UDP to have different external IPs.

Co-authored-by: domosekai <54519668+domosekai@users.noreply.github.com>
2021-04-14 19:49:30 +02:00
Davide Beatrici 192083e7c4 Merge PR #1321: Change IP structure so that IPv4 addresses are stored in RFC3493 format 2021-04-07 21:37:42 +02:00
Davide Beatrici 1708998a11 Change IP structure so that IPv4 addresses are stored in RFC3493 format
In addition to saving 4 bytes for each instantiation, this change makes IP-related operations faster and clearer.

https://tools.ietf.org/html/rfc3493.html#section-3.7
2021-04-07 21:24:55 +02:00
Davide Beatrici 01663f836d Merge PR #1320: Add (No) Code of Conduct 2021-04-06 20:00:52 +02:00
Davide Beatrici 4ec2995604 Add (No) Code of Conduct
https://nocodeofconduct.com
2021-04-06 19:43:00 +02:00
Davide Beatrici a6ba9b8788 Include headers properly 2021-04-05 04:48:25 +02:00
Davide Beatrici 5cab279a8c Cedar, Mayaqua: Set minimum Windows version to Vista 2021-04-03 02:25:19 +02:00
Davide Beatrici 3e17c818a6 Merge PR #1317: Mayaqua/Network.c: Always use fcntl() to toggle socket non-blocking mode (UNIX) 2021-04-01 19:23:45 +02:00
Davide Beatrici 84588095d5 Mayaqua/Network.c: Always use fcntl() to toggle socket non-blocking mode (UNIX)
O_NONBLOCK is standardized by POSIX, as opposed to FIONBIO.

This commit also fixes a bug: fcntl() was only called to disable the mode.
2021-04-01 08:04:27 +02:00
Davide Beatrici a79f91161f Merge PR #1316: Bump y18n from 4.0.0 to 4.0.1 in /src/bin/hamcore/wwwroot/admin/default 2021-03-30 20:29:50 +02:00
Davide Beatrici ac04e15b72 Merge PR #1313: Merge Windows manifest files into a single one 2021-03-30 07:15:48 +02:00
Davide Beatrici 4db6247b80 Merge Windows manifest files into a single one 2021-03-27 00:33:20 +01:00
Davide Beatrici 3761876254 Merge PR #1306: Mayaqua: Fix UDP send error when used with reverse proxy 2021-03-23 19:46:11 +01:00
Davide Beatrici b7e7d3b028 Merge PR #1296: Update BUILD_UNIX.md dependencies 2021-03-13 04:21:36 +01:00
Davide Beatrici 9d29d8813b New vpndrvinst implementation, independent from Cedar and Mayaqua
This greatly improves performance and reduces the binary's size (~0.2 MB vs ~5 MB).

All recent Windows versions are supported, starting with Vista.

No dialogs are created, aside from error/warning ones in case of failure.

The only dependency (aside from Windows libraries) is libhamcore.
2021-03-12 05:46:20 +01:00
Davide Beatrici 68367fa2fb hamcore: Restore warning_*.txt files
They were accidentally removed in 8e2616ef7d.
2021-03-11 20:15:20 +01:00
Davide Beatrici d5fa90cc71 Merge PR #1293: hamcorebuilder: Use libhamcore to build archive 2021-03-10 03:11:11 +01:00
Davide Beatrici 68574e9af9 hamcorebuilder: Use libhamcore to build archive
https://github.com/SoftEtherVPN/libhamcore
2021-03-10 02:13:00 +01:00
Davide Beatrici de03b3ec59 Merge PR #1292: Bump elliptic from 6.5.3 to 6.5.4 in /src/bin/hamcore/wwwroot/admin/default 2021-03-09 20:13:44 +01:00
Davide Beatrici b00aa39b29 Merge PR #1289: CMake: Fix regular expression for BLAKE2 SSE2 source files selection 2021-03-02 01:30:58 +01:00
Davide Beatrici 2d82d84fd5 CMake: Fix regular expression for BLAKE2 SSE2 source files selection
The comparison was being made against the variable's name instead of its value, causing the result to always be true.
For reference: https://cmake.org/cmake/help/v3.10/manual/cmake-generator-expressions.7.html#genex:BOOL

In addition to that, this commit also fixes the source file name of the non-SSE2 code.
2021-03-01 23:24:34 +01:00
Davide Beatrici 42dbfb7c7e Merge PR #1287: Cedar/WinUi.c: Remove reference to "vpncmd_x64.exe" and "vpncmd_ia64.exe" 2021-03-01 04:45:30 +01:00
Davide Beatrici ef5c32dca1 Merge PR #1286: Azure Pipelines: Replace "x86_64" with "x64", for consistency with the codebase 2021-03-01 04:36:50 +01:00
Davide Beatrici 65483499bf Cedar/WinUi.c: Remove reference to "vpncmd_x64.exe" and "vpncmd_ia64.exe"
It was missed in a3eb115b0a.
2021-03-01 04:27:43 +01:00
Davide Beatrici 3ffdda6c13 Azure Pipelines: Replace "x86_64" with "x64", for consistency with the codebase 2021-03-01 04:03:28 +01:00
Davide Beatrici 3d69a71d9b Merge PR #1200: Implement support for WireGuard 2021-03-01 03:59:35 +01:00
Davide Beatrici 4506b60e80 Merge PR #1282: Use bool from stdbool.h, get rid of BOOL 2021-03-01 03:44:22 +01:00