]> tinc-vpn.org Git - tinc/log
tinc
8 days agoGet more tests running in containers 1.1
Guus Sliepen [Mon, 6 Apr 2026 14:29:32 +0000 (16:29 +0200)]
Get more tests running in containers

8 days agoAdd workaround for ip netns exec misbehaving in containers
Guus Sliepen [Mon, 6 Apr 2026 14:28:21 +0000 (16:28 +0200)]
Add workaround for ip netns exec misbehaving in containers

8 days agoFix more warnings from Clang
Guus Sliepen [Mon, 6 Apr 2026 14:26:15 +0000 (16:26 +0200)]
Fix more warnings from Clang

9 days agoSkip raw socket test if we cannot create veth interfaces
Guus Sliepen [Sun, 5 Apr 2026 11:20:11 +0000 (13:20 +0200)]
Skip raw socket test if we cannot create veth interfaces

9 days agoFix installing git before actions/checkout
Guus Sliepen [Sun, 5 Apr 2026 11:07:56 +0000 (13:07 +0200)]
Fix installing git before actions/checkout

9 days agoFix muon build in Alpine
Guus Sliepen [Sun, 5 Apr 2026 11:07:46 +0000 (13:07 +0200)]
Fix muon build in Alpine

9 days agoCI pipeline dependency fixes
Guus Sliepen [Sun, 5 Apr 2026 10:36:30 +0000 (12:36 +0200)]
CI pipeline dependency fixes

- Explicitly install iproute2 in slim containers
- Explicitly install libclang-rt-dev to get working sanitizers
- Use the distro's Python cryptography package
- Install git before running actions/checkout if we need the repository

10 days agoMore CI pipeline fixes
Guus Sliepen [Sat, 4 Apr 2026 22:32:23 +0000 (00:32 +0200)]
More CI pipeline fixes

10 days agoFix systemd-dev and qemu-user-binfmt dependencies
Guus Sliepen [Sat, 4 Apr 2026 22:21:09 +0000 (00:21 +0200)]
Fix systemd-dev and qemu-user-binfmt dependencies

10 days agoExplicitly install Clang for those tests that need it
Guus Sliepen [Sat, 4 Apr 2026 22:20:43 +0000 (00:20 +0200)]
Explicitly install Clang for those tests that need it

10 days agoFix pkgconf dependency when cross-compiling
Guus Sliepen [Sat, 4 Apr 2026 19:01:25 +0000 (21:01 +0200)]
Fix pkgconf dependency when cross-compiling

10 days agoDon't use bash unnecessarily
Guus Sliepen [Sat, 4 Apr 2026 17:23:06 +0000 (19:23 +0200)]
Don't use bash unnecessarily

10 days agoDon't use sudo in the CI pipeline scripts
Guus Sliepen [Sat, 4 Apr 2026 17:22:46 +0000 (19:22 +0200)]
Don't use sudo in the CI pipeline scripts

Just rely on the fact that we are already root inside the container.

10 days agoUse muon packaged by distributions
Guus Sliepen [Sat, 4 Apr 2026 15:35:43 +0000 (17:35 +0200)]
Use muon packaged by distributions

Alpine and Debian have muon packages nowadays. Use an Alpine image in the
CI pipeline for testing muon.

10 days agoFix building if there is no openssl/engine.h
Guus Sliepen [Sat, 4 Apr 2026 14:59:08 +0000 (16:59 +0200)]
Fix building if there is no openssl/engine.h

10 days agoImprove dependency installation in CI pipeline
Guus Sliepen [Sat, 4 Apr 2026 14:58:40 +0000 (16:58 +0200)]
Improve dependency installation in CI pipeline

- Use --no-install-recommends for Debian derivatives
- Use the right systemd-dev package on Debian
- Remove texinfo from other distributions as it pulls in a lot of TeX
  packages
- Remove some unnecessary packages on Fedora and related distros

10 days agoFix meson dependency in CI pipeline
Guus Sliepen [Sat, 4 Apr 2026 13:36:45 +0000 (15:36 +0200)]
Fix meson dependency in CI pipeline

11 days agoUpdate THANKS
Guus Sliepen [Fri, 3 Apr 2026 18:56:54 +0000 (20:56 +0200)]
Update THANKS

11 days agoMake test/run.sh executable
Guus Sliepen [Fri, 3 Apr 2026 18:55:18 +0000 (20:55 +0200)]
Make test/run.sh executable

11 days agoUse latest version of macOS in the CI pipeline
Guus Sliepen [Fri, 3 Apr 2026 18:54:34 +0000 (20:54 +0200)]
Use latest version of macOS in the CI pipeline

11 days agoStop pylint from complaining about import order
Guus Sliepen [Fri, 3 Apr 2026 18:50:59 +0000 (20:50 +0200)]
Stop pylint from complaining about import order

Unfortunately, the multiprocessing library conflicts with something in
tinc's test library. Reordering imports fixes this, but pylint doesn't
like it. For now just disable pylint in favor of a working test suite.

11 days agoFix test suite running on Alpine edge
Guus Sliepen [Fri, 3 Apr 2026 18:35:06 +0000 (20:35 +0200)]
Fix test suite running on Alpine edge

11 days agoSkip raw socket test if we don't have the required privileges
Guus Sliepen [Fri, 3 Apr 2026 15:10:51 +0000 (17:10 +0200)]
Skip raw socket test if we don't have the required privileges

This can happen in an unprivileged container where it looks like we are
root, but we don't have NET_RAW privileges.

11 days agoSpelling fixes
Guus Sliepen [Fri, 3 Apr 2026 15:09:22 +0000 (17:09 +0200)]
Spelling fixes

Found by codespell.

11 days agoDocument how to run parts of the CI pipeline locally
Guus Sliepen [Fri, 3 Apr 2026 15:00:52 +0000 (17:00 +0200)]
Document how to run parts of the CI pipeline locally

11 days agofix: resolve -Wdiscarded-qualifiers warnings in ifconfig_route and complete_config
Rudi Heitbaum [Fri, 3 Apr 2026 05:28:00 +0000 (05:28 +0000)]
fix: resolve -Wdiscarded-qualifiers warnings in ifconfig_route and complete_config

In ifconfig_route, remove const from the value parameter as it is
written through via sep (*sep++ = 0) and is only called from finalize_join()
with a mutable buffer.

In complete_config, change dot to const char* as it is only used for
pointer arithmetic and reading, never written through.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
12 days agoMore CI pipeline fixes
Guus Sliepen [Thu, 2 Apr 2026 13:33:36 +0000 (15:33 +0200)]
More CI pipeline fixes

- Assume OpenSSL 3 is available
- Simplify GitHub workflow
- Bump versions of all actions

12 days agoMake sourcehut builds use the latest version of each image
Guus Sliepen [Thu, 2 Apr 2026 10:16:00 +0000 (12:16 +0200)]
Make sourcehut builds use the latest version of each image

13 days agoMore CI pipeline fixes
Guus Sliepen [Wed, 1 Apr 2026 22:05:59 +0000 (00:05 +0200)]
More CI pipeline fixes

- Use apt instead of apt-get
- Use libgcrypt20-dev on Debian
- Fix CFLAGS on macOS
- Skip ATTR_DEALLOCATOR when using Clang to avoid warnings
- Use tempfile.mkstemp() in test scripts
- Don't explicitly specify MPC_FAMILY
- Re-add forward-declarations of wrapped functions to avoid warnings

13 days agoFix deps.sh script
Guus Sliepen [Wed, 1 Apr 2026 20:55:40 +0000 (22:55 +0200)]
Fix deps.sh script

13 days agoAdd workarounnd for bug in LZO2 header files
Guus Sliepen [Wed, 1 Apr 2026 20:32:15 +0000 (22:32 +0200)]
Add workarounnd for bug in LZO2 header files

The header <lzo1x.h> includes <lzo/lzoconf.h>, which should have been
<lzoconf.h>, or the pkg-config file is wrong. This is mainly an issue on
macOS when installing LZO2 via Homebrew.

13 days agoFix build issues in CI pipline
Guus Sliepen [Wed, 1 Apr 2026 20:02:15 +0000 (22:02 +0200)]
Fix build issues in CI pipline

- Don't try to manually compile OpenSSL 3.0 for Fedora and related distros
- Use meson provided by Debian instead of using pip
- Make sure to install binfmt-support and pkgconf

13 days agoRemove mipsel from CI pipeline
Guus Sliepen [Wed, 1 Apr 2026 20:00:06 +0000 (22:00 +0200)]
Remove mipsel from CI pipeline

It's no longer supported by Debian stable, nor by most other distributions.

13 days agoFix building muon in the CI pipeline
Guus Sliepen [Wed, 1 Apr 2026 14:23:42 +0000 (16:23 +0200)]
Fix building muon in the CI pipeline

13 days agoWrite CI pipeline logs to local directory
Guus Sliepen [Wed, 1 Apr 2026 14:23:27 +0000 (16:23 +0200)]
Write CI pipeline logs to local directory

2 weeks agoUpdate meson wraps
Guus Sliepen [Tue, 31 Mar 2026 15:20:30 +0000 (17:20 +0200)]
Update meson wraps

2 weeks agofix build failures
Rui Chen [Sun, 15 Sep 2024 21:03:59 +0000 (17:03 -0400)]
fix build failures

seeing some build failure while building for macos sequoia, the error is below:

```
  net_socket.c:105:14: error: no member named 'ifr_ifrn' in 'struct ifreq'
    105 |         strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
        |                 ~~~ ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/secure/_string.h:128:28: note: expanded from macro 'strncpy'
    128 |                 __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
        |                                          ^~~~
  net_socket.c:105:14: error: no member named 'ifr_ifrn' in 'struct ifreq'
    105 |         strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
        |                 ~~~ ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/secure/_string.h:128:62: note: expanded from macro 'strncpy'
    128 |                 __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
        |                                                                            ^~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/secure/_common.h:41:54: note: expanded from macro '__darwin_obsz'
     41 | #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
        |                                                      ^~~~~~
```

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/10837004674/job/30072048690

Signed-off-by: Rui Chen <rui@chenrui.dev>
2 weeks agoFix more clang-tidy warnings
Guus Sliepen [Mon, 30 Mar 2026 21:20:53 +0000 (23:20 +0200)]
Fix more clang-tidy warnings

2 weeks agoUpdate THANKS.
Guus Sliepen [Thu, 26 Feb 2026 21:13:20 +0000 (22:13 +0100)]
Update THANKS.

2 weeks agoCode formatting
Guus Sliepen [Mon, 30 Mar 2026 20:39:08 +0000 (22:39 +0200)]
Code formatting

2 weeks agoUse the more portable `ifreq.ifr_name` alias for `ifreq.ifr_ifrn.ifrn_name`
Eric Karge [Tue, 15 Apr 2025 16:37:51 +0000 (18:37 +0200)]
Use the more portable `ifreq.ifr_name` alias for `ifreq.ifr_ifrn.ifrn_name`

2 weeks agoFix includes for vmnet
Eric Karge [Tue, 15 Apr 2025 16:27:19 +0000 (18:27 +0200)]
Fix includes for vmnet

2 weeks agoFix indentation
Eric Karge [Thu, 13 Feb 2025 12:25:32 +0000 (13:25 +0100)]
Fix indentation

2 weeks agoAdd support for vmnet-bridged and vmnet-shared
Eric Karge [Thu, 13 Feb 2025 12:19:19 +0000 (13:19 +0100)]
Add support for vmnet-bridged and vmnet-shared

2 weeks agoAdd documentation for macOS vmnet devices
Eric Karge [Fri, 11 Oct 2024 14:59:59 +0000 (16:59 +0200)]
Add documentation for macOS vmnet devices

2 weeks agoRead vmnet options from config
Eric Karge [Fri, 11 Oct 2024 14:43:54 +0000 (16:43 +0200)]
Read vmnet options from config

2 weeks agoFixes
Eric Karge [Fri, 11 Oct 2024 14:21:26 +0000 (16:21 +0200)]
Fixes

- Fix file description
- Fix some log messages
- Fix formatting and typos

2 weeks agoFix copyright notice
Eric Karge [Fri, 11 Oct 2024 14:09:50 +0000 (16:09 +0200)]
Fix copyright notice

2 weeks agoSupport vmnet on macOS
Eric Karge [Fri, 11 Oct 2024 13:41:55 +0000 (15:41 +0200)]
Support vmnet on macOS

2 weeks agoFix warnings from clang-tidy-23
Guus Sliepen [Mon, 30 Mar 2026 13:34:33 +0000 (15:34 +0200)]
Fix warnings from clang-tidy-23

But also disable clang-tidy-23 checks that produce false positives.

2 weeks agoFix tarpitting logic detecting connections from the same host
Guus Sliepen [Sat, 28 Mar 2026 15:03:18 +0000 (16:03 +0100)]
Fix tarpitting logic detecting connections from the same host

2 weeks agoPython formatting fixes
Guus Sliepen [Sat, 28 Mar 2026 14:57:37 +0000 (15:57 +0100)]
Python formatting fixes

2 weeks agoDrop too short packets with relay header
Guus Sliepen [Sat, 28 Mar 2026 14:56:41 +0000 (15:56 +0100)]
Drop too short packets with relay header

2 weeks agoCorrect for offset when (de)compressing packets
Guus Sliepen [Sat, 28 Mar 2026 14:48:43 +0000 (15:48 +0100)]
Correct for offset when (de)compressing packets

2 weeks agoMove constant time equality comparison function to utils
Guus Sliepen [Sat, 28 Mar 2026 13:48:02 +0000 (14:48 +0100)]
Move constant time equality comparison function to utils

5 months agoAppease the linters
Guus Sliepen [Sun, 9 Nov 2025 21:59:06 +0000 (22:59 +0100)]
Appease the linters

5 months agoHandle libminiupnpc API versions between 17 and 21
Guus Sliepen [Sun, 9 Nov 2025 21:08:04 +0000 (22:08 +0100)]
Handle libminiupnpc API versions between 17 and 21

5 months agoCI: bump distribution and compiler versions
Guus Sliepen [Sun, 9 Nov 2025 20:43:44 +0000 (21:43 +0100)]
CI: bump distribution and compiler versions

5 months agosr.ht CI: bump OpenBSD and NetBSD images
Guus Sliepen [Sun, 9 Nov 2025 16:24:32 +0000 (17:24 +0100)]
sr.ht CI: bump OpenBSD and NetBSD images

5 months agoBump actions/upload-artifact from 2 to 4
Guus Sliepen [Sun, 9 Nov 2025 16:21:28 +0000 (17:21 +0100)]
Bump actions/upload-artifact from 2 to 4

5 months agoBump actions/download-artifact from 2 to 4.1.7 in /.github/workflows
Guus Sliepen [Sun, 9 Nov 2025 16:09:42 +0000 (17:09 +0100)]
Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

5 months agoAvoid compiler warnings from arrays initialized by strings
Guus Sliepen [Sun, 9 Nov 2025 16:05:11 +0000 (17:05 +0100)]
Avoid compiler warnings from arrays initialized by strings

2 years agoGitHub CI: update list of container images
Guus Sliepen [Sun, 7 Apr 2024 15:27:43 +0000 (17:27 +0200)]
GitHub CI: update list of container images

Remove explicit versions, and instead use :latest and other aliases. Try
to get a latest stable release and a development release for several
well-known distributions. Drop CentOS as it is no longer supported.

2 years agosr.ht CI: update FreeBSD and OpenBSD image versions
Guus Sliepen [Sun, 7 Apr 2024 14:01:53 +0000 (16:01 +0200)]
sr.ht CI: update FreeBSD and OpenBSD image versions

2 years agoHandle multicast being blocked in the test suite
Guus Sliepen [Sun, 7 Apr 2024 13:44:00 +0000 (15:44 +0200)]
Handle multicast being blocked in the test suite

If multicast is supported in principle, but multicast packets are blocked
by the firewall, then the multicast test will time out and reports an
error. Detect this case and don't fail.

2 years agoRun ip link up before adding addresses and routes
Guus Sliepen [Sun, 7 Apr 2024 13:41:04 +0000 (15:41 +0200)]
Run ip link up before adding addresses and routes

On Linux, some iproute2 commands to set addresses and add routes don't work
or have no effect if the link is not up, so make sure we set the link up
first.

2 years agoFix bug in shortest path implementation
Jingrong Chen [Mon, 22 Jan 2024 23:13:01 +0000 (18:13 -0500)]
Fix bug in shortest path implementation

2 years agoAdd a unit test for sssp_bfs()
Jingrong Chen [Mon, 22 Jan 2024 23:09:25 +0000 (18:09 -0500)]
Add a unit test for sssp_bfs()

2 years agoAdd distribution specific package installation instructions
Marek Küthe [Tue, 12 Dec 2023 14:54:18 +0000 (14:54 +0000)]
Add distribution specific package installation instructions

Signed-off-by: Marek Küthe <m.k@mk16.de>
2 years agoCorrect a type mismatch
Marek Küthe [Tue, 12 Dec 2023 15:06:17 +0000 (15:06 +0000)]
Correct a type mismatch

In one place in the source code, the debug level of type `int` was used and in other places of type `debug_t`. This commit introduces a change so that the type `debug_t` is used in both places.
This also resolves a compiler warning.

Signed-off-by: Marek Küthe <m.k@mk16.de>
3 years agoAdd timeouts to 'tinc join'
Kirill Isakov [Sun, 5 Jun 2022 11:06:05 +0000 (17:06 +0600)]
Add timeouts to 'tinc join'

Since server tarpits suspicious connections, `tinc join` doesn't have
the best UX (if anything is broken on server's side, `tinc join` just
hangs indefinitely).

Since we don't want to leak information to the client, add timeouts on
the client side and notify the user that something is amiss if timeout
is reached.

3 years agoUpdate MaxConnectionBurst values in docs
Kirill Isakov [Sun, 5 Jun 2022 09:56:01 +0000 (15:56 +0600)]
Update MaxConnectionBurst values in docs

3 years agoversion.py: fix support for Python < 3.9
Kirill Isakov [Sat, 4 Jun 2022 12:34:34 +0000 (18:34 +0600)]
version.py: fix support for Python < 3.9

3 years agoAdd tests for some device & address variables
Kirill Isakov [Sat, 4 Jun 2022 09:05:32 +0000 (15:05 +0600)]
Add tests for some device & address variables

3 years agoRemove access checks in tests under root
Kirill Isakov [Sun, 29 May 2022 15:45:28 +0000 (21:45 +0600)]
Remove access checks in tests under root

3 years agoCI: run sanitizers as root
Kirill Isakov [Thu, 2 Jun 2022 06:30:48 +0000 (12:30 +0600)]
CI: run sanitizers as root

The most interesting tests that actually exercise network
require root access for setup.

3 years agoSilence clang-tidy warnings about atoi(getenv())
Kirill Isakov [Thu, 2 Jun 2022 12:47:18 +0000 (18:47 +0600)]
Silence clang-tidy warnings about atoi(getenv())

3 years agoFix listen_sockets overflow in close_network_connections()
Kirill Isakov [Mon, 30 May 2022 17:06:39 +0000 (23:06 +0600)]
Fix listen_sockets overflow in close_network_connections()

==32610==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f4f6a8 at pc 0x000000533bd6 bp 0x7ffeafc6f390 sp 0x7ffeafc6f388
READ of size 8 at 0x000000f4f6a8 thread T0
    #0 0x533bd5 in io_del /home/runner/work/tinc/tinc/openssl3/../src/linux/event.c:104:9
    #1 0x4f4808 in close_network_connections /home/runner/work/tinc/tinc/openssl3/../src/net_setup.c:1283:3
    #2 0x4cea70 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:717:2
    #3 0x7f493a1d3d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #4 0x7f493a1d3e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #5 0x421ac4 in _start (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x421ac4)

0x000000f4f6a8 is located 8 bytes to the right of global variable 'listen_socket' defined in '../src/net_socket.c:48:17' (0xf4f0e0) of size 1472
SUMMARY: AddressSanitizer: global-buffer-overflow /home/runner/work/tinc/tinc/openssl3/../src/linux/event.c:104:9 in io_del

3 years agoShorter paths to PID files in integration tests
Kirill Isakov [Tue, 31 May 2022 19:30:58 +0000 (01:30 +0600)]
Shorter paths to PID files in integration tests

Tests were running into the 108-char limit on UNIX socket path length.

Since we don't care about saving PID files and sockets for further
analysis if anything does wrong with the test, just shove them into a
temporary directory (which is likely to have a very short name).

3 years agoCI: add check for paths over the 108-char limit
Kirill Isakov [Tue, 31 May 2022 14:20:13 +0000 (20:20 +0600)]
CI: add check for paths over the 108-char limit

3 years agoDon't retry outgoing connections if node is connected
Kirill Isakov [Fri, 20 May 2022 12:41:01 +0000 (18:41 +0600)]
Don't retry outgoing connections if node is connected

3 years agoExtract filesystem-related functions into fs.c
Kirill Isakov [Thu, 19 May 2022 10:16:51 +0000 (16:16 +0600)]
Extract filesystem-related functions into fs.c

… and add unit tests.

3 years agoImprove recently seen address cache
Kirill Isakov [Thu, 19 May 2022 07:04:20 +0000 (13:04 +0600)]
Improve recently seen address cache

- create cache directory on init
- only remember addresses for TCP connections
- update cache in more situations
- add tests

3 years agoAdd Markdown reformat to lint.py
Kirill Isakov [Sun, 29 May 2022 05:24:04 +0000 (11:24 +0600)]
Add Markdown reformat to lint.py

3 years agoReflow all Markdown files.
Guus Sliepen [Sat, 28 May 2022 21:12:52 +0000 (23:12 +0200)]
Reflow all Markdown files.

Use MarkFlow to reflow the Markdown files so they can be read as a text
file in a 80-column terminal. Also convert all code blocks into fenced
code blocks with a language header, and remove the prompt character;
this allows viewers to do syntax highlighting, and allows a human
reading the files using a text viewer to simply copy&paste the commands.

3 years agoCI: add checks for basic compatibility with muon
Kirill Isakov [Sat, 28 May 2022 19:20:23 +0000 (01:20 +0600)]
CI: add checks for basic compatibility with muon

3 years agoCI: add backwards compatibility checks
Kirill Isakov [Sat, 28 May 2022 12:27:09 +0000 (18:27 +0600)]
CI: add backwards compatibility checks

3 years agoMake build files compatible with muon
Kirill Isakov [Sat, 28 May 2022 13:13:44 +0000 (19:13 +0600)]
Make build files compatible with muon

3 years agoAdd tests for import/export errors
Kirill Isakov [Thu, 26 May 2022 18:51:42 +0000 (00:51 +0600)]
Add tests for import/export errors

3 years agoAdd tests for join/invite errors
Kirill Isakov [Thu, 26 May 2022 08:20:34 +0000 (14:20 +0600)]
Add tests for join/invite errors

3 years agoAdd tests for key generation commands
Kirill Isakov [Wed, 25 May 2022 13:09:10 +0000 (19:09 +0600)]
Add tests for key generation commands

3 years agoAdd tests for miscellaneous commands
Kirill Isakov [Wed, 25 May 2022 08:34:34 +0000 (14:34 +0600)]
Add tests for miscellaneous commands

3 years agoAdd tests for network commands
Kirill Isakov [Wed, 25 May 2022 15:13:25 +0000 (21:13 +0600)]
Add tests for network commands

3 years agoAdd tests for dump commands
Kirill Isakov [Tue, 24 May 2022 16:29:46 +0000 (22:29 +0600)]
Add tests for dump commands

3 years agoAdd tests for sign/verify commands
Kirill Isakov [Fri, 27 May 2022 11:22:05 +0000 (17:22 +0600)]
Add tests for sign/verify commands

3 years agoCI: don't fail on chown error
Kirill Isakov [Wed, 25 May 2022 14:25:41 +0000 (20:25 +0600)]
CI: don't fail on chown error

3 years agoFix UB pointer comparison in event.c
Kirill Isakov [Wed, 25 May 2022 16:52:06 +0000 (22:52 +0600)]
Fix UB pointer comparison in event.c

==36472==ERROR: AddressSanitizer: invalid-pointer-pair: 0x000000e9de00 0x608000000db0
    #0 0x4d0658 in timeout_compare /home/runner/work/tinc/tinc/openssl3/../src/event.c:97:7
    #1 0x55a3af in splay_top_down /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:41:13
    #2 0x559868 in splay_search_closest_node /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:378:9
    #3 0x55cd54 in splay_insert_node /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:446:13
    #4 0x4cecfc in timeout_set /home/runner/work/tinc/tinc/openssl3/../src/event.c:267:6
    #5 0x4d3c49 in retry /home/runner/work/tinc/tinc/openssl3/../src/net.c:477:2
    #6 0x53f274 in control_h /home/runner/work/tinc/tinc/openssl3/../src/control.c:96:3
    #7 0x500a44 in receive_request /home/runner/work/tinc/tinc/openssl3/../src/protocol.c:180:7
    #8 0x5485b2 in receive_meta /home/runner/work/tinc/tinc/openssl3/../src/meta.c:308:19
    #9 0x4d1c18 in handle_meta_connection_data /home/runner/work/tinc/tinc/openssl3/../src/net.c:305:6
    #10 0x4fa3cc in handle_meta_io /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:560:3
    #11 0x4cfbe3 in event_loop /home/runner/work/tinc/tinc/openssl3/../src/event.c:453:5
    #12 0x4d4127 in main_loop /home/runner/work/tinc/tinc/openssl3/../src/net.c:508:6
    #13 0x4cbe24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:702:11
    #14 0x7f1900c1e082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #15 0x41eafd in _start (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x41eafd)

0x000000e9de00 is located 0 bytes inside of global variable 'pingtimer' defined in '../src/net.c:44:18' (0xe9de00) of size 80
0x608000000db0 is located 16 bytes inside of 96-byte region [0x608000000da0,0x608000000e00)
allocated by thread T0 here:
    #0 0x499ed2 in calloc (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x499ed2)
    #1 0x4fc6a9 in xzalloc /home/runner/work/tinc/tinc/openssl3/../src/xalloc.h:41:12
    #2 0x4fbfb0 in try_outgoing_connections /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:855:27
    #3 0x4d31ac in reload_configuration /home/runner/work/tinc/tinc/openssl3/../src/net.c:435:2
    #4 0x53f2bd in control_h /home/runner/work/tinc/tinc/openssl3/../src/control.c:101:16
    #5 0x500a44 in receive_request /home/runner/work/tinc/tinc/openssl3/../src/protocol.c:180:7
    #6 0x5485b2 in receive_meta /home/runner/work/tinc/tinc/openssl3/../src/meta.c:308:19
    #7 0x4d1c18 in handle_meta_connection_data /home/runner/work/tinc/tinc/openssl3/../src/net.c:305:6
    #8 0x4fa3cc in handle_meta_io /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:560:3
    #9 0x4cfbe3 in event_loop /home/runner/work/tinc/tinc/openssl3/../src/event.c:453:5
    #10 0x4d4127 in main_loop /home/runner/work/tinc/tinc/openssl3/../src/net.c:508:6
    #11 0x4cbe24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:702:11
    #12 0x7f1900c1e082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)

3 years agoFix UBSAN failure in b64decode_tinc()
Kirill Isakov [Wed, 25 May 2022 15:52:42 +0000 (21:52 +0600)]
Fix UBSAN failure in b64decode_tinc()

../src/utils.c:141:14: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
    #0 0x478d06 in b64decode_tinc /home/runner/work/tinc/tinc/openssl3/../src/utils.c:141:14
    #1 0x437f6c in dump_invitations /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:1116:6
    #2 0x42ebf6 in cmd_dump /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:1190:10
    #3 0x42b4c5 in run_command /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:3315:11
    #4 0x42aa24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:3366:15
    #5 0x7f6fb7a4c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #6 0x406e2d in _start (/home/runner/work/tinc/tinc/openssl3/src/tinc+0x406e2d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/utils.c:141:14 in

3 years agoDon't tarpit localhost connections
Kirill Isakov [Fri, 27 May 2022 12:07:04 +0000 (18:07 +0600)]
Don't tarpit localhost connections

3 years agoSplit event.c into per-API files
Kirill Isakov [Sun, 22 May 2022 07:28:03 +0000 (13:28 +0600)]
Split event.c into per-API files