Commit Graph

3756 Commits

Author SHA1 Message Date
Nikos Mavrogiannopoulos
fbfbdc058a tests: use sec-mod-scale on cookie tests
This ensures we catch issues similar to !288.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-09-15 15:19:19 +02:00
Nikos Mavrogiannopoulos
26258d7cb1 Revert "Fixing issue: Authentication requests from the same IP address are not load balanced among security modules"
Each cookie is valid for its IP address and when reconnected it must
reach the same sec-mod that contains the corresponding session
information.

This reverts commit 4ec99609ca.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-09-15 15:19:13 +02:00
Nikos Mavrogiannopoulos
6dd533a10c bumped version
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-09-02 20:54:15 +02:00
Nikos Mavrogiannopoulos
16b86e751a Merge branch 'TODO' into 'master'
Why not delete TODO instead of only emptying it?

See merge request openconnect/ocserv!365
2023-09-02 18:52:26 +00:00
Dimitri Papadopoulos
ab8a05e4c2 Why not delete TODO instead of only emptying it?
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-09-01 18:29:21 +03:00
Nikos Mavrogiannopoulos
6aad62e266 debug: increased default log-level to debug
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-28 20:48:02 +02:00
Nikos Mavrogiannopoulos
895a23f372 release 1.2.1
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
1.2.1
2023-08-22 15:10:32 +02:00
Nikos Mavrogiannopoulos
b2ab415f7a doc update
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-22 15:09:34 +02:00
Nikos Mavrogiannopoulos
e665fd5a5b Account the correct number of points when proxyproto is in use
When the proxy protocol is used ensure that authentication failure
will credit the right number of points to the actual client IP
address.

Resolves: #529

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-19 20:51:48 +02:00
Nikos Mavrogiannopoulos
59400941cf tests: verify that address got by the proxy matches the client
Also measure whether ban points are credited to the right
address for failed attempts.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-17 16:14:14 +02:00
Dimitri Papadopoulos Orfanos
e269f22a43 Merge branch 'fix-user-json' into 'master'
fix(occtl): correct key for Limit TX in JSON output

See merge request openconnect/ocserv!363
2023-08-15 17:51:02 +00:00
Florian Domain
2c375721c1 fix(occtl): correct key for Limit TX in JSON output
* `TX` key is present twice in `occtl --json show users` output, the first
  key turns out to be the Limit TX configured.

Signed-off-by: Florian Domain <f.domain@criteo.com>
2023-08-14 11:01:49 +02:00
Nikos Mavrogiannopoulos
5c738a8c45 build-aux: removed legacy gnulib files
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-27 22:41:25 +02:00
Nikos Mavrogiannopoulos
d7b07677fe release.sh: added script to do the release process
This does the release of the tarballs, the git tagging and
the release of gitlab.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-27 22:39:37 +02:00
Nikos Mavrogiannopoulos
1c5c02b057 doc update
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-27 15:53:16 +02:00
Nikos Mavrogiannopoulos
02442aabbc Replaced nuttcp tests with iperf3
iperf3 is consistently included in all distributions we
are testing at, in contrast with nuttcp.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-27 15:50:33 +02:00
Nikos Mavrogiannopoulos
c393d4d7b4 vhost: do not require setting device per vhost
It is not necessary to specify the device config directive on
each virtual host configuration. Ensure that we don't require it
by mistake. This also introduces a traffic test when operating
with virtual hosts.

Resolves: #480

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 16:32:34 +02:00
Nikos Mavrogiannopoulos
870086600c main-sec-mod: Added explicit check for too extreme length values
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 11:48:07 +02:00
Nikos Mavrogiannopoulos
a4b8f2a237 config: correctly set tcp port on vhosts
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 11:42:27 +02:00
Nikos Mavrogiannopoulos
6edfb7f104 ipc.proto: time_t is sent in 64 bit value
This prevents Y2K38 issues.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 11:38:23 +02:00
Nikos Mavrogiannopoulos
0cc4a469ab worker-svc: added check on cstp_printf
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 11:28:38 +02:00
Nikos Mavrogiannopoulos
35fd6ddf4d Merge branch 'tmp-clavister' into 'master'
Accept the clavister android client

Closes #485

See merge request openconnect/ocserv!361
2023-07-14 14:25:09 +00:00
Nikos Mavrogiannopoulos
66a1fc8de3 worker: accept clavister's VPN connect request
The clavister oneconnect VPN client for android issues an
incorrect URL for the connection. Accept it.

Resolves: #485

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-14 15:57:39 +02:00
Nikos Mavrogiannopoulos
ea7cb0a09f Added lib-link and dependencies for AC_LIB_HAVE_LINKFLAGS macro
These macros were part of the gnulib, and they are not available
by default on system. They become available pretty randomly as they
get installed by arbitrary software (e.g., gettext-devel on my system).
We now make them available unconditionally ensuring we can compile
ocserv on a freshly installed system.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-14 15:57:39 +02:00
Nikos Mavrogiannopoulos
8f4ed396c2 worker: print alerts received during TLS handshake
This also makes the tlslib macros more consistent.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-14 15:57:19 +02:00
Nikos Mavrogiannopoulos
78e25f4ff6 .gitlab-ci.yml: introduced a signoff check
This also moves any static analyzers checks early in the testing
phases ti catch basic errors faster.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-13 02:05:55 +02:00
Nikos Mavrogiannopoulos
7c8abd2e2c NEWS: updated for next release
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 19:39:09 +02:00
Nikos Mavrogiannopoulos
b09b1b81de tests: added missing file
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 18:11:06 +02:00
Nikos Mavrogiannopoulos
49bee78af8 updated news for release
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
1.2.0
2023-07-11 17:04:33 +02:00
Nikos Mavrogiannopoulos
70ceee36d6 sample.config: corrected documentation [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 14:54:57 +02:00
Nikos Mavrogiannopoulos
9bd97bde91 .gitlab-ci.yml: added ubuntu22.04
There is an issue with gssapi on this version of Ubuntu. While
the package exists, it doesn't work as openssl doesn't support
md4. See https://bugs.launchpad.net/ubuntu/+source/gss-ntlmssp/+bug/1995915

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 14:47:32 +02:00
Nikos Mavrogiannopoulos
42b125a32f configure: bumped version
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 14:47:23 +02:00
Nikos Mavrogiannopoulos
9e457abda8 Merge branch 'cisco-ipphone' into 'master'
Add support for Cisco IP-Phone Enterprise firmware VPN

See merge request openconnect/ocserv!356
2023-07-11 12:46:40 +00:00
Gareth Palmer
996d021e1b Add support for Cisco IP-Phone Enterprise firmware VPN client.
The VPN client that comes with the Cisco IP-Phone Enterprise
firmware is based on AnyConnect but was unable to authenticate
with ocserv.

The phone makes an initial GET request and looks for a cookie
named 'webvpn' that has an expiry attribute and a cookie named
'webvpnlogin' containing a non-empty value.

When username+password mode is configured, the phone will then
send a POST request containing those credentials. When using
certificate authentication an empty POST request is sent.

A handler that implements this new behaviour has been added
under the '/svc' path.

To use DTLS 'dtls-legacy' must be enabled and 'udp-port' must
be 443, a new 'cisco-svc-client-compat' option automatically
checks those settings.

New test cases test-pass-svc and test-cert-svc check the above
behaviour.

Older versions of the phone's firmware will fail to create the
DTLS tunnel if the cipher negotiated for HTTPS does not match
that selected for DTLS.

To work-around this either disable DTLS or only allow the
RSA-AES-256-CBC/SHA1 or RSA-AES-128-CBC/SHA1 cipher to be used.

doc/README-cisco-svc.md includes additional information.

Note: 'Enterprise' here is used to differentiate between that
firmware and the MPP (Multi-Platform) firmware which uses the
same hardware.

Signed-off-by: Gareth Palmer <gareth.palmer3@gmail.com>
2023-07-11 22:48:22 +12:00
Nikos Mavrogiannopoulos
5841da06b6 .gitlab-ci.yml: static-analyzer: enable optional code
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-07 12:05:58 +02:00
Nikos Mavrogiannopoulos
58d510d0a5 vhost: corrected issue under scan-build
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-07 12:04:11 +02:00
Nikos Mavrogiannopoulos
6ba30cd781 openidconnect: corrected possible cleanup issue
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-07 12:03:47 +02:00
Nikos Mavrogiannopoulos
7ddf10e28c Merge branch 'tmp-fix-do-while-in-macro-issues' into 'master'
Replace "Macros starting with if should be enclosed by a do - while loop"

See merge request openconnect/ocserv!357
2023-07-07 06:36:54 +00:00
Nikos Mavrogiannopoulos
fc5d24abaf use brackets in defines to avoid potential side effects
This replaces the logic of using do-while, and the logic of using
no brackets to get the best of both worlds. The reason for using
brackets is to avoid obscure logic bugs when including the macro in
a complex logic, while the replacement of the do-while is to ensure
that we can continue using keywords like 'continue' and 'break' within
the macros.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-06 21:31:59 +02:00
Nikos Mavrogiannopoulos
c4c6590aeb Revert "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects"
This reverts commit b5380f2181.
This resolves this issue identified by coverity:
462455 Unexpected control flow

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-06 21:30:11 +02:00
Nikos Mavrogiannopoulos
52f64c4032 sample.config: added more information on how logging works
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-05 18:37:46 +02:00
Nikos Mavrogiannopoulos
b0c45ffc50 .gitlab-ci.yml: use the new centos images
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-06-26 13:31:19 +02:00
Dimitri Papadopoulos Orfanos
2eaf754c51 Merge branch '_XOPEN_SOURCE' into 'master'
_XOPEN_SOURCE → AC_USE_SYSTEM_EXTENSIONS

See merge request openconnect/ocserv!354
2023-06-22 18:15:41 +00:00
Nikos Mavrogiannopoulos
e547733d61 tests: removed legacy tests and added missing ones
Added test-group-cert and test-fork tests that were
present but were never included in the CI test suite.

Removed unix-test which was an obsolete test present
in tests/.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-06-22 12:29:02 +02:00
Dimitri Papadopoulos
baecb64e3d _XOPEN_SOURCE → AC_USE_SYSTEM_EXTENSIONS
Do not define _GNU_SOURCE directly in sources.
We just need to include "config.h" instead.

This is a follow-up to 1ca50d73: autoconf macro AC_USE_SYSTEM_EXTENSIONS
will define _GNU_SOURCE or _XOPEN_SOURCE in "config.h" as needed.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-06-20 11:32:25 +02:00
Dimitri Papadopoulos Orfanos
354e13f7c1 Merge branch 'print_single_value_int_0' into 'master'
Call print_single_value_int() with has_more = 1

Closes #517

See merge request openconnect/ocserv!349
2023-06-20 09:29:41 +00:00
Nikos Mavrogiannopoulos
a28ffdd4c3 Test both --debug and plain options.
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-06-20 06:58:00 +00:00
Nikos Mavrogiannopoulos
f1648c9d0f Merge branch 'strcasestr' into 'master'
Get rid of strcasestr.c vendored file

See merge request openconnect/ocserv!353
2023-06-19 08:28:36 +00:00
Dimitri Papadopoulos
b6658a8eaa Get rid of strcasestr.c vendored file
The initial indea was to move strcasestr.c out of src/common,
as it only used by the main program, perhaps changing to the
OpenBSD implementation at the same time instead of falling back
to the Gnulib test.

Then it appeared we probably don't support systems without strcasestr().
I checked ihe following systems support it:
- glibc
- uClibc    https://git.uclibc.org/uClibc/tree/libc/string/strcasestr.c
- musl libc https://git.musl-libc.org/cgit/musl/tree/src/string/strcasestr.c
- Bionic    https://android.googlesource.com/platform/bionic/+log/master/libc/string/strcasestr.c
- Newlib    https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/string/strcasestr.c
- FreeeBSD  https://cgit.freebsd.org/src/tree/lib/libc/string/strcasestr.c
- OpenBSD   https://cvsweb.openbsd.org/src/lib/libc/string/strcasestr.c
- NetBSD    http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/string/strcasestr.c
- Solaris   https://docs.oracle.com/cd/E88353_01/html/E37843/strcasestr-3c.html

It might appear not to be available when _GNU_SOURCE or equivalent macros
have not been defined. Now with AC_USE_SYSTEM_EXTENSIONS, I doubt the
function is missing on any platform, therefore I get rid of the test and
the Gnulib fallback.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-06-19 08:33:59 +02:00
Nikos Mavrogiannopoulos
e74a0b7e47 Merge branch 'gnulib' into 'master'
Remove remaining references to Gnulib

See merge request openconnect/ocserv!350
2023-06-18 09:12:49 +00:00