Commit Graph
4201 Commits
Author SHA1 Message Date
Dimitri Papadopoulos 592745b8b9 inih: silence static analysis error
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2026-01-25 13:22:37 +01:00
Dimitri Papadopoulos 28252bff8f inih: increased max line size
Re-apply e7233819.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2026-01-25 13:22:37 +01:00
Dimitri Papadopoulos 44d58a049c inih: updated to latest version r62
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2026-01-25 13:22:37 +01:00
Nikos Mavrogiannopoulos 58321bf626 Merge branch 'min-reauth-time' into 'master'
Rename min-reauth-time to ban-time

Closes #676

See merge request openconnect/ocserv!497
2026-01-25 09:08:47 +00:00
Grigory Trenin 9cc0191236 occtl: Fix 'show ip bans' may produce invalid JSON (#683)
Modified the printing logic to use a 'comma-before' approach instead of
'comma-after'.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-23 12:54:43 -05:00
Grigory Trenin b080d7dd2b Rename min-reauth-time to ban-time (#676)
Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-23 05:44:05 -05:00
Grigory Trenin 0ed29607b6 .gitignore: add generated and cleanup legacy files (gnulib, libopts)
Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-19 08:43:45 -05:00
Nikos Mavrogiannopoulos 1c156d8325 Merge branch 'docs/man-tidy' into 'master'
docs: tidy up man pages

See merge request openconnect/ocserv!494
2026-01-11 12:02:01 +00:00
Grigory TreninandNikos Mavrogiannopoulos 74ebc5ec8a Strip domain suffix from hostname
The hostname validation was rejecting any hostname containg a '.'
character (eg: 'MacBook-Air.local'). This was overly restrictive and
prevented the HOSTNAME environment variable from being populated for
a signifficant number of clients, particularly on macOS.

Strip the domain suffix from such hostnames instead of discarding them.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-11 09:15:14 +01:00
Nikos Mavrogiannopoulos 8cdce81e6e .gitlab-ci.yml: increased job parallelization
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-11 09:04:18 +01:00
Nikos Mavrogiannopoulos 29786781ed tests: resumption: enhanced and avoid the use of gnutls-cli insecure option
This test was improved to test resumption with TLS 1.3 in addition to TLS 1.2
as well as improve fallback on centos10. This patch introduces validation using
the right CA file.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-11 09:04:18 +01:00
Nikos Mavrogiannopoulos ebea140c5f Added centos10 build in CI
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-11 09:04:18 +01:00
Nikos Mavrogiannopoulos f4d72259e7 Merge branch 'tests-strlcpy' into 'master'
tests: replace strcpy() with strlcpy()

See merge request openconnect/ocserv!493
2026-01-11 08:03:17 +00:00
Grigory Trenin 08c321c41a docs: tidy up man pages
- Updated the SYNOPSIS of ocserv(8), occtl(8), and ocpasswd(8)
  to match their --help output
- Corrected usage syntax (eg: '-c config' is optional for ocserv,
  'username' is required for ocpasswd).
- Removed non-standard ':' trailing from options definitions
- Documented missing command-line options: --log-stderr,  --syslog,
  --no-chdir, --traceable
- Added default configuration file paths:
  /etc/ocserv/ocserv.conf, /etc/ocserv/ocpasswd
- Documented USER_AGENT environment variable
- Fixed typos

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-10 18:05:02 -05:00
Grigory Trenin 8636464880 tests: replace strcpy() with strlcpy()
- Replaced strcpy() with strlcpy() in test files
- Added linking to libcommon.a (and its dependency libnettle)
  as not all systems provide strlcpy()
- Centralized syslog_open variable by moving it from multiple definitions
  in main.c, worker.c, and test files into log.c. This avoids duplication
  and resolves a linking conflict with libcommon.a

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-07 15:46:16 -05:00
Dimitri Papadopoulos Orfanos 0d58edf884 Merge branch 'bugfix/ban-columns' into 'master'
occtl: Fix column misalignment in ban command outputs

See merge request openconnect/ocserv!490
2026-01-05 17:42:44 +02:00
Grigory Trenin e40d735316 occtl: Fix column misalignment in ban command outputs
- Increase the width from 14 to 15 characters for 'show bans' and
'show ban points' commands. This ensures proper column alignment
for all valid IPv4 addresses.

- Reduce Score column to 10 characters since UINT_MAX is typically
10 digits.

- Remove unnecessary (unsinged int) cast since 'score' is an actual
unsigned int.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-04 13:32:51 -05:00
Nikos Mavrogiannopoulos 1837b5877d NEWS: updated for 1.4.1
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-04 15:11:37 +01:00
Nikos Mavrogiannopoulos 5f5ac6fe65 Released 1.4.0
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
1.4.0
2026-01-04 14:41:44 +01:00
Nikos Mavrogiannopoulos 59d205b3e8 Merge branch 'bugfix/mtu-stats' into 'master'
Fix max_mtu calculation in server stats

See merge request openconnect/ocserv!488
2026-01-03 14:51:06 +00:00
Dimitri Papadopoulos 79f8eb35f8 Don't forget to initialise udp_port for vhost
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2026-01-03 11:11:36 +02:00
Grigory Trenin 98015b1b24 Fix max_mtu calculation in server stats
proc->mtu was incorrectly compared against min_mtu instead of max_mtu

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-02 16:34:59 -05:00
Nikos Mavrogiannopoulos 5e39f4c7f0 Merge branch 'tmp-fedora42' into 'master'
Updated CI to fedora42

See merge request openconnect/ocserv!487
2026-01-02 16:25:40 +00:00
Nikos Mavrogiannopoulos 8366100ebf Merge branch 'tmp-no-yajl' into 'master'
tests: use jq to test json correctness

Closes #679

See merge request openconnect/ocserv!486
2026-01-02 16:00:50 +00:00
Nikos Mavrogiannopoulos da61847df9 isolate: ensure calling chdir('/') after chroot
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-02 16:58:18 +01:00
Nikos Mavrogiannopoulos 8ddc9b6abd Updated CI to fedora42
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-02 16:45:56 +01:00
Nikos Mavrogiannopoulos 5d75e3fd74 Removed centos7 builds (EOL)
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-02 16:45:46 +01:00
Nikos Mavrogiannopoulos 5fad4f93dd tests: use jq to test json correctness
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-02 11:18:23 +01:00
Nikos Mavrogiannopoulos ef075f6b83 get_auth_handler2: update to reflect username and password ask
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-01 20:14:20 +01:00
Lee KeitelandNikos Mavrogiannopoulos 70d936ca95 Fix network namespace setup script
At least my machine was generating IDs that were to long and any test
that required networking wouldn't work. This patch restricts the
namespace names to 4 digits.

Signed-off-by: Lee Keitel <lee@keitel.xyz>
2026-01-01 20:14:15 +01:00
Lee KeitelandNikos Mavrogiannopoulos 6e5bbcf5ac Combine username and password in one form
Fixes issue #551.

This patch combines the initial username and password text fields
into a single form. Subsequent requests due to a wrong password
would receive only the password field as before. This mimicks
AnyConnect's default behaviour.

Signed-off-by: Lee Keitel <lee@keitel.xyz>
2026-01-01 20:06:27 +01:00
Nikos Mavrogiannopoulos e12b278260 fixed typo
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-01-01 17:38:10 +01:00
Dimitri PapadopoulosandNikos Mavrogiannopoulos 300f986a70 .gitlab-ci.yml: forget the Ubuntu 16 image
We don't use UBUNTU_BUILD in CI any more.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2026-01-01 17:32:08 +01:00
Grigory TreninandNikos Mavrogiannopoulos 1893047e8f Fix irregular stats-report-time
Currently 'ocserv' sends session accounting statistics at irregular intervals.
For example, if 'stats-report-time' is set to 60, the actual intervals may vary
between 50, 60, 70, or even 80 seconds.  Moreover, these intervals are not
constant - they fluctuate arbitrarily with each statistics update.

This behavior was intentionally introduced to avoid worker processes acting
simultaneously in scenarios like server restarts, where all clients reconnect
at the same time, which could impose heavy load on the secmod process.

However, it causes issues for RADIUS servers that require accurate and
consistent timing.

Summary of changes:
 - Apply randomization only once when the timer is initially set up, affecting
   only the first timer firing.  All subsequent firings will occur at regular
   intervals relative to the first one.
 - Remove fuzzing from 'interim_update_secs'. This value originates either from
   RADIUS or from 'stats-report-time' and should not be altered.

Closes: #630

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-01 17:31:01 +01:00
Grigory TreninandNikos Mavrogiannopoulos dbbe6de40c Fix premature ban score reset for short ban periods
When ban period is minimal, the 'now > e->expires' condition alone
cleared scores before a client was banned.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-01 17:15:37 +01:00
Grigory TreninandNikos Mavrogiannopoulos 0f53e0d6d9 Communicate secmod address to worker after successful authentication
This ensures all subsequent worker communications reach the original
secmod instance that authenticated the client, enabling correct session
accounting after IP address changes.

Closes: #674

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2025-12-21 11:41:51 +01:00
Grigory TreninandNikos Mavrogiannopoulos afa34bbd10 Fix ban score reset logic
The previous condition for resetting a ban score was insufficient.
It failed to reset the score for a client that had just exited a ban,
and also incorrectly reset the score of a currently banned client,
causing premature unbans.

Closes: #678

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2025-12-21 11:24:19 +01:00
Grigory TreninandNikos Mavrogiannopoulos d15b2af4b2 Fix 'occtl show ip bans' showing expired ban entries
Added current timestamp comparison to ensure only active bans
are shown by 'occtl show ip bans'.

Closes: #675.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2025-12-21 10:54:16 +01:00
Grigory TreninandNikos Mavrogiannopoulos 1c31314df4 occtl: Fix missing column headers in 'show ip bans' output
Existing code used the loop index 'i == 0' to determine when to print
column headers. However, a 'continue' statement inside the loop could
skip the 'i = 0' iteration, causing the headers to never be printed.

Introduced a separate boolean 'header_printed' variable to track
whether headers have been printed.

Closes: #677

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2025-12-21 10:52:20 +01:00
Grigory TreninandNikos Mavrogiannopoulos 3892e032d9 Fix DTLS with systemd socket activation
Remove IPV6_V6ONLY flag from per-client UDP sockets as it prevents
IPv4 traffic on systemd-provided IPv6 sockets. This was a legacy
from the old reopen_udp_port() code and is no longer needed.

Fixes: #647

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2025-12-21 10:48:59 +01:00
Nikos Mavrogiannopoulos 9833ca4789 .triage-policies.yml: use the new draft rule
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2025-12-21 10:36:14 +01:00
Nikos Mavrogiannopoulos 826aa0503f Signoff rules: ignore the misformed commit 6a65e3acdd
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2025-12-21 10:31:48 +01:00
Dimitri Papadopoulos Orfanos acf8c5bc6a Merge branch 'tmp-do_while' into 'master'
Simplify do/while loops

See merge request openconnect/ocserv!458
2025-12-06 11:39:32 +01:00
Dimitri Papadopoulos Orfanos 86c214feb9 Merge branch 'tmp-printf' into 'master'
Modernize printf() format

See merge request openconnect/ocserv!436
2025-12-06 11:20:28 +01:00
Dimitri Papadopoulos Orfanos c5acc8580e Merge branch 'tmp-llhtp' into 'master'
llhttp: updated to latest version 9.3.0

See merge request openconnect/ocserv!459
2025-12-06 11:15:36 +01:00
Dimitri Papadopoulos Orfanos c545361202 Merge branch 'tmp-CID-356061' into 'master'
Fix issue flagged by Coverity

See merge request openconnect/ocserv!460
2025-12-06 11:14:21 +01:00
Dimitri Papadopoulos Orfanos 31b3d6b930 Merge branch 'tmp-cloexec' into 'master'
Update cloexec.* vendored files

See merge request openconnect/ocserv!439
2025-12-06 11:10:11 +01:00
Dimitri Papadopoulos Orfanos 70a4269e38 Merge branch 'tmp-sigaltstack_RESOURCE_LEAK' into 'master'
Silence coverity

See merge request openconnect/ocserv!446
2025-12-06 11:09:29 +01:00
Dimitri Papadopoulos Orfanos e5de27a316 Merge branch 'tmp-main' into 'master'
Main() signature compliant with C standard

See merge request openconnect/ocserv!438
2025-12-06 11:08:40 +01:00
Dimitri Papadopoulos Orfanos 134ae37a13 Merge branch 'tmp-freeradius-client-1.1.8' into 'master'
Work around API breakage in freeradius-client 1.1.8

Closes #650

See merge request openconnect/ocserv!453
2025-12-06 11:08:18 +01:00