]> www.infradead.org Git - users/dwmw2/openconnect.git/log
users/dwmw2/openconnect.git
3 months agoMerge branch 'oncp-large-config-hacks' into 'master' master
David Woodhouse [Tue, 14 Jan 2025 12:40:31 +0000 (12:40 +0000)]
Merge branch 'oncp-large-config-hacks' into 'master'

Handle yet more oNCP framing idiocy

See merge request openconnect/openconnect!588

3 months agoUpdate translations from GNOME
David Woodhouse [Tue, 14 Jan 2025 10:47:45 +0000 (10:47 +0000)]
Update translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoHandle yet more oNCP framing idiocy
David Woodhouse [Mon, 13 Jan 2025 17:02:01 +0000 (17:02 +0000)]
Handle yet more oNCP framing idiocy

This protocol doesn't use TLS record framing, but *does* have its own
framing, each frame starting with a very minimal 2-byte frame length.

These frames can be larger than 16KiB which is the maximum size of a TLS
record. So ensure that we loop, reading a full frame where necessary.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoMerge branch 'obs' into 'master'
David Woodhouse [Mon, 13 Jan 2025 12:09:51 +0000 (12:09 +0000)]
Merge branch 'obs' into 'master'

Fix links to Open Build Service

Closes #611

See merge request openconnect/openconnect!587

3 months agoFix links to Open Build Service
Dimitri Papadopoulos [Mon, 13 Jan 2025 08:22:58 +0000 (09:22 +0100)]
Fix links to Open Build Service

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agoFix OpenSSL build without engine.h
David Woodhouse [Fri, 10 Jan 2025 17:24:55 +0000 (17:24 +0000)]
Fix OpenSSL build without engine.h

Newer versions of OpenSSL don't provide engine.h at all.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoMerge branch 'xstrdup' into 'master'
David Woodhouse [Fri, 10 Jan 2025 17:08:11 +0000 (17:08 +0000)]
Merge branch 'xstrdup' into 'master'

Remove duplicate strdup() calls

See merge request openconnect/openconnect!566

3 months agoMerge branch 'switch_while' into 'master'
David Woodhouse [Fri, 10 Jan 2025 17:06:56 +0000 (17:06 +0000)]
Merge branch 'switch_while' into 'master'

style: switch and while are not functions

See merge request openconnect/openconnect!580

3 months agoMerge branch 'tmp-mingw-copr' into 'master'
David Woodhouse [Fri, 10 Jan 2025 16:56:55 +0000 (16:56 +0000)]
Merge branch 'tmp-mingw-copr' into 'master'

Fix COPR builds for mingw

Closes #710

See merge request openconnect/openconnect!538

3 months agoFix typo in sockwrap workaround
David Woodhouse [Fri, 10 Jan 2025 16:50:08 +0000 (16:50 +0000)]
Fix typo in sockwrap workaround

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoRemove duplicate strdup() calls
Dimitri Papadopoulos [Tue, 30 Jul 2024 17:02:13 +0000 (19:02 +0200)]
Remove duplicate strdup() calls

The arguments of openconnect_set_mobile_info() have been strdup'ed:
- prior to passing them to openconnect_set_mobile_info(),
- inside openconnect_set_mobile_info().

We don't need both. I have chosen to keep the strdup() call inside
openconnect_set_mobile_info(), and discard the strdup() of the arguments
just before calling openconnect_set_mobile_info().

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agoMerge branch 'tmp-SSLContext' into 'master'
Dimitri Papadopoulos Orfanos [Thu, 9 Jan 2025 17:00:44 +0000 (17:00 +0000)]
Merge branch 'tmp-SSLContext' into 'master'

Fix CI deprecation warning

See merge request openconnect/openconnect!571

3 months agoMerge branch 'ics-openconnect' into 'master'
Dimitri Papadopoulos Orfanos [Thu, 9 Jan 2025 16:45:34 +0000 (16:45 +0000)]
Merge branch 'ics-openconnect' into 'master'

Address compiler warnings (ics-openconnect build)

See merge request openconnect/openconnect!583

3 months agoFix missing newline in Slovenian translation
David Woodhouse [Thu, 9 Jan 2025 12:06:46 +0000 (12:06 +0000)]
Fix missing newline in Slovenian translation

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoAdd corrected string for Slovenian
David Woodhouse [Thu, 9 Jan 2025 09:13:14 +0000 (09:13 +0000)]
Add corrected string for Slovenian

This wasn't being pulled in from NetworkManager-openconnect because the
(fuzzy) translation had %s format specifiers. Fix it manually.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoUpdate en_GB and en_US translations
David Woodhouse [Thu, 9 Jan 2025 09:37:44 +0000 (09:37 +0000)]
Update en_GB and en_US translations

Not much excuse for these to be so far down the list of stats in
https://l10n.gnome.org/module/NetworkManager-openconnect/

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoUpdate translations from GNOME
David Woodhouse [Thu, 9 Jan 2025 08:52:01 +0000 (08:52 +0000)]
Update translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoResync translations with sources
David Woodhouse [Thu, 9 Jan 2025 08:43:35 +0000 (08:43 +0000)]
Resync translations with sources

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoUpdate Chinese translation (zh_CN)
stever kevin [Thu, 9 Jan 2025 08:14:32 +0000 (08:14 +0000)]
Update Chinese translation (zh_CN)

Signed-off-by: stever kevin <24898890-mkevinstever@users.noreply.gitlab.com>
3 months agoMerge branch 'update_packaging' into 'master'
Luca Boccassi [Wed, 8 Jan 2025 22:43:01 +0000 (22:43 +0000)]
Merge branch 'update_packaging' into 'master'

Update Debian packaging from Salsa repo

See merge request openconnect/openconnect!581

3 months agoPass extra warning flags to the compiler
Dimitri Papadopoulos [Tue, 7 Jan 2025 18:36:07 +0000 (19:36 +0100)]
Pass extra warning flags to the compiler

This is an attempt to match the flags passed by the Android NDK when
building ics-openconnect.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agoFix CI deprecation warning
Dimitri Papadopoulos Orfanos [Sat, 19 Oct 2024 15:47:25 +0000 (17:47 +0200)]
Fix CI deprecation warning

fake-cisco-server.py:205: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated.
fake-cisco-server.py:205: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated

All ssl.PROTOCOL_TLS* constants have been added in Python 3.6, and
the default PROTOCOL_TLS has been deprecated since Python 3.10.

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agoAddress compiler warnings (ics-openconnect build)
Dimitri Papadopoulos [Tue, 7 Jan 2025 17:28:32 +0000 (18:28 +0100)]
Address compiler warnings (ics-openconnect build)

They are caused by the use of the GCC options:
  -Wparentheses
  -Wunused-function

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agotests: set SOCKET_WRAPPER_DIR_ALLOW_ORIG
David Woodhouse [Tue, 7 Jan 2025 13:20:13 +0000 (13:20 +0000)]
tests: set SOCKET_WRAPPER_DIR_ALLOW_ORIG

This allows the sockwrap library to use the original relative path of its
directory, instead of failing when realpath() gives an absolute pathname
which is too long. This was causing the COPR builds to fail on newer
versions of Fedora (with newer sockwrap).

Closes: #770
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agotests: Don't recreate sockdir after cleanup()
David Woodhouse [Tue, 7 Jan 2025 13:06:54 +0000 (13:06 +0000)]
tests: Don't recreate sockdir after cleanup()

Ever since commit bba8db3e922d ("modify tests/common.sh so that
launch_simple_sr_server() → test → cleanup() can be used repeatedly in a
single script") the cleanup() function has left an empty socket wrapper
directory behind.

Instead of recreating it in cleanup(), do so in launch_simple_sr_server()
launch_simple_pppd().

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoAllow tests to run over IPv6 as well as Legacy IP
David Woodhouse [Fri, 5 Apr 2024 16:23:22 +0000 (17:23 +0100)]
Allow tests to run over IPv6 as well as Legacy IP

When run in an environment with no Legacy IP addresses, or no IPv6 addresses,
AI_ADDRCONFIG will cause getaddrinfo() not to return addresses of that type.

So when running in an IPv6-only environment, ocserv doesn't listen on Legacy
IP. And thus the tests fail. Fix this by using a hostname 'sockwrap' for the
test connections, and providing '--resolve' arguments for both the Legacy IP
and IPv6 addresses handled by libsocket_wrapper.

Some of the python test servers which don't use AI_ADDRCONFIG do still work
on Legacy IP, so leave those alone for now.

We recently added '-4' to the socat invocation for the nullppp tests, for
similar reasons (becaose socat started listening on IPv6 by default). We
can remove that now too.

Closes #721

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoUse libsocket_wrapper for juniper-sso-auth test
David Woodhouse [Fri, 5 Apr 2024 16:21:09 +0000 (17:21 +0100)]
Use libsocket_wrapper for juniper-sso-auth test

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoAccept multiple --resolve arguments
David Woodhouse [Fri, 5 Apr 2024 16:08:40 +0000 (17:08 +0100)]
Accept multiple --resolve arguments

e.g. --resolve sockwrap:fd00:5357:5f02 --resolve sockwrap:127.0.0.2 to
try reaching the socket wrapper tests over both IPv6 and Legacy IP.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 months agoUpdate Debian packaging from Salsa repo
Luca Boccassi [Fri, 3 Jan 2025 17:44:25 +0000 (17:44 +0000)]
Update Debian packaging from Salsa repo

Fixes builds in Debian testing

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
3 months agostyle: switch and while are not functions
Dimitri Papadopoulos Orfanos [Tue, 31 Dec 2024 14:41:02 +0000 (15:41 +0100)]
style: switch and while are not functions

K&R and Linux Kernel coding style expect a space after these keywords:
if, switch, case, for, do, while

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
3 months agoMerge branch 'autotools' into 'master'
Nikos Mavrogiannopoulos [Sat, 28 Dec 2024 20:29:51 +0000 (20:29 +0000)]
Merge branch 'autotools' into 'master'

Add automake/autoconf to requirements

Closes #775

See merge request openconnect/openconnect!579

3 months agoMerge branch 'android-build' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 25 Dec 2024 22:12:34 +0000 (22:12 +0000)]
Merge branch 'android-build' into 'master'

Bump android dependencies

See merge request openconnect/openconnect!572

4 months agoAdd automake/autoconf to requirements
Dimitri Papadopoulos Orfanos [Tue, 24 Dec 2024 11:46:40 +0000 (12:46 +0100)]
Add automake/autoconf to requirements

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
4 months agoMerge branch 'tmp-wintun-rework' into 'master'
Nikos Mavrogiannopoulos [Fri, 20 Dec 2024 14:39:09 +0000 (14:39 +0000)]
Merge branch 'tmp-wintun-rework' into 'master'

Rework adapter handling for Windows

See merge request openconnect/openconnect!569

4 months agoandroid: update ci
Arthur Khachaturov [Tue, 29 Oct 2024 15:39:11 +0000 (18:39 +0300)]
android: update ci

Signed-off-by: Arthur Khachaturov <me@wzray.ru>
4 months agoandroid: update download mirrors
Arthur Khachaturov [Tue, 29 Oct 2024 15:27:06 +0000 (18:27 +0300)]
android: update download mirrors

Signed-off-by: Arthur Khachaturov <me@wzray.ru>
4 months agoandroid: bump dependencies
Arthur Khachaturov [Tue, 29 Oct 2024 15:26:45 +0000 (18:26 +0300)]
android: bump dependencies

Signed-off-by: Arthur Khachaturov <me@wzray.ru>
4 months agoMerge branch 'saml-tunnelgroup-fix' into 'master'
Nikos Mavrogiannopoulos [Fri, 29 Nov 2024 19:24:46 +0000 (19:24 +0000)]
Merge branch 'saml-tunnelgroup-fix' into 'master'

Don't default form action to '/' in AnyConnect/OpenConnect XML form handling

Closes #737

See merge request openconnect/openconnect!560

4 months agoMerge branch 'tmp-ci-timeout' into 'master'
Nikos Mavrogiannopoulos [Thu, 28 Nov 2024 14:14:13 +0000 (14:14 +0000)]
Merge branch 'tmp-ci-timeout' into 'master'

socat: added a timeout to ensure that it exits eventually

See merge request openconnect/openconnect!576

4 months agoDon't default form action to '/' in AnyConnect/OpenConnect XML form handling (fixes...
Stefan Bühler [Wed, 19 Jun 2024 14:01:10 +0000 (16:01 +0200)]
Don't default form action to '/' in AnyConnect/OpenConnect XML form handling (fixes #737)

Still require action to be non-empty if present.

Form action "redirect" handling code in auth.c already works with
action==NULL (as in not building a new URL).  (It'd do weird things
with an empty action though.)

Signed-off-by: Stefan Bühler <source@stbuehler.de>
5 months agosocat: added a timeout to ensure that it exits eventually
Nikos Mavrogiannopoulos [Sat, 23 Nov 2024 07:53:36 +0000 (08:53 +0100)]
socat: added a timeout to ensure that it exits eventually

Relates: #757

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
5 months agoUse RFC9266 'tls-exporter' channel bindings for Cisco STRAP with TLSv1.3
David Woodhouse [Fri, 15 Nov 2024 15:46:05 +0000 (15:46 +0000)]
Use RFC9266 'tls-exporter' channel bindings for Cisco STRAP with TLSv1.3

Fixes #659

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
5 months agoDon't use adapters of unknown type when an explicit interface is
Marios Paouris [Sun, 10 Nov 2024 07:00:44 +0000 (09:00 +0200)]
Don't use adapters of unknown type when an explicit interface is
requested

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoBugfix for check_address_conflicts call
Marios Paouris [Fri, 18 Oct 2024 20:23:06 +0000 (23:23 +0300)]
Bugfix for check_address_conflicts call

If check_address_conflict fails then the adapter would remain open.
Also, don't unnecessarily call this function.

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoImproved adapter name generation when no adapter name is specified.
Marios Paouris [Sat, 12 Oct 2024 14:56:34 +0000 (17:56 +0300)]
Improved adapter name generation when no adapter name is specified.

Try to find an adapter name that is not already used in the system by
appending a monotonically increasing integer to the hostname that is
used as a default name.

This works around wintun's weird behaviour of renaming existing adapters
without preventing two or more instances of openconnect to connect to
the same VPN host (without explicity specifying an interface name), or
otherwise messing with user's network adapters.

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoUse hostname as Wintun ifname (if ifname not specified), v2
Marios Paouris [Mon, 7 Oct 2024 05:53:35 +0000 (08:53 +0300)]
Use hostname as Wintun ifname (if ifname not specified), v2

The intention for the commit 48bd28aa was a bit different
from what was actually implemented.

Although it states that "Instead, we should use the VPN server's hostname
as a sane default interface name with Wintun, and only attempt to use
TAP-Windows as a fallback in the case where Wintun can't be initialized.",
it first tries with an empty interface name, which uses the first available
interface found, whether it is tap or tun, and if that fails then creates
the same default with the server name, which will prioritize wintun over
tap.

Instead, implement the following flow:

If the user did specify an interface name:
  - Try to find an adapter with the specified name (whether it's tun
    or tap) and use it.
  - If no adapter found, try to create a wintun adapter. If wintun is
    not available then bail out.
If the user did not specify an interface name:
  - Generate a default interface name based on the server URL.
  - If the generated interface already exists don't try to use it
    and fallback to using the first available adapter.
  - If the generated interface doesn't exist, try to create a wintun
    adapter. If wintun in not available then fallback to using the first
    available adapter.

See https://gitlab.com/openconnect/openconnect-gui/-/issues/357#note_1758999655
and https://gitlab.com/openconnect/openconnect/-/issues/699#note_1762029017

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoFix memory leaks. openconnect__win32_strerror returns a malloc\'ed string
Marios Paouris [Mon, 23 Sep 2024 06:12:27 +0000 (09:12 +0300)]
Fix memory leaks. openconnect__win32_strerror returns a malloc\'ed string

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoRework adapter search.
Marios Paouris [Mon, 23 Sep 2024 05:42:09 +0000 (08:42 +0300)]
Rework adapter search.

Enumerate adapters to a list to decouple searching from enumerating.
Add adapters with of not interested types to the list, to facilitate name
collision detection, if needed.
Get Wintun adapter guid by calling APIs instead of searching again.

Also, disabled list-taps on cross mingw builds

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
5 months agoMerge branch 'OpenSSL_3.1.2_PKCS7_sign' into 'master'
Nikos Mavrogiannopoulos [Sun, 3 Nov 2024 18:47:58 +0000 (18:47 +0000)]
Merge branch 'OpenSSL_3.1.2_PKCS7_sign' into 'master'

Fix CI pipeline failures

See merge request openconnect/openconnect!573

5 months agoFix CI pipeline failures
Charles Lane [Sun, 29 Sep 2024 21:58:55 +0000 (17:58 -0400)]
Fix CI pipeline failures

OpenSSL 3.1.2 doesn't like a NULL for the PKCS7_sign 'data' argument.

Signed-off-by: Charles Lane <lane@dchooz.org>
Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
6 months agoMerge branch 'tmp-mingw-nsis' into 'master'
Dimitri Papadopoulos Orfanos [Thu, 26 Sep 2024 06:09:42 +0000 (06:09 +0000)]
Merge branch 'tmp-mingw-nsis' into 'master'

Generate the NSIS installer when building on MSYS2/MinGW

See merge request openconnect/openconnect!563

8 months agoMerge branch 'handle_GP_ESP_magic_address_corner_case' into 'master'
Daniel Lenski [Tue, 30 Jul 2024 16:19:30 +0000 (16:19 +0000)]
Merge branch 'handle_GP_ESP_magic_address_corner_case' into 'master'

GP server may send only a Legacy IP client address but both Legacy and IPv6 magic addresses for ESP

See merge request openconnect/openconnect!565

8 months agoUpdate changelog
Daniel Lenski [Sun, 28 Jul 2024 00:38:01 +0000 (17:38 -0700)]
Update changelog

This also addresses the closely-related issue described in
https://gitlab.com/openconnect/openconnect/-/merge_requests/500, where
OpenConnect would prefer a GP server's IPv6 magic ping adress over its
Legacy IP magic ping address, even if `--disable-ipv6` is specified:
> Previous logic always preferred the ipv6 gateway address and magic for ESP
> even if ipv6 was explicitly disabled.  A VPN I use currently will only
> negotiate an ESP connection over ipv4 despite advertising a v6 gateway.

This similarly results in non-functional ESP:

> The result was that with ipv6 enabled, ESP pings were sent but would not
> renegotiate, with it disabled openconnect would erroneously report that
> the response did not contain a matching gateway and keys.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
8 months agoAdd a fake IPSEC/ESP configuration to fake-gp-server.py
Daniel Lenski [Sat, 27 Jul 2024 22:04:58 +0000 (15:04 -0700)]
Add a fake IPSEC/ESP configuration to fake-gp-server.py

This allows testing for correct interpretation of the ESP configuration, as in
https://lists.infradead.org/pipermail/openconnect-devel/2024-July/005447.html

Also needed to fix a mistake in the logout handler of fake-gp-server.py
("POST not GET"), and an oversight in how GP propagated errors when falling
back to TLS tunnel from ESP.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
8 months agoGP server may send only a Legacy IP client address, but both Legacy and IPv6 magic...
Daniel Lenski [Sat, 27 Jul 2024 17:58:28 +0000 (10:58 -0700)]
GP server may send only a Legacy IP client address, but both Legacy and IPv6 magic addresses for ESP

In this corner case, we need to use the Legacy IP magic address.  The
inverse corner case would be if the server sends ESP ping magic addresses of
both types, but only sends an IPv6 client address; we were already handling
that one correctly, because we had observed that GlobalProtect servers
require the client to use the IPv6 magic ping address if they want to send
both IPv6 and Legacy IP traffic.

The easiest and most straightforward way to handle all these cases robustly
is simply to save both versions of the ESP magic address, just as we save
both versions of the client address, until after we have parsed the whole
config. At that point we decide which ESP magic address should be used.

See logs attached to
https://lists.infradead.org/pipermail/openconnect-devel/2024-July/005447.html
for an example of this:

    POST https://vpnhost.example.com/ssl-vpn/getconfig.esp
    …
    <               <gw-address>REDACTEDIPV4ADDRESS7</gw-address>
    <               <gw-address-v6>REDACTEDIPV6ADDRESS7</gw-address-v6>
    <               <ipv6-connection>no</ipv6-connection>
    <               <ip-address>REDACTEDIPV4ADDRESS0</ip-address>
    <               <netmask>255.255.255.255</netmask>
    …
    <               <ipsec>…</ipsec>
    Did not receive ESP keys and matching gateway in GlobalProtect config; tunnel will be TLS only.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
9 months agoGenerate the NSIS installer when building on MSYS2/MinGW
Marios Paouris [Fri, 19 Jul 2024 05:36:16 +0000 (08:36 +0300)]
Generate the NSIS installer when building on MSYS2/MinGW

When building under MSYS2/MinGW generate windows-style paths for instfiles.nsh
as makensis on windows expects them that way.

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
9 months agoMerge branch 'tmp-wintun-long-names' into 'master'
Nikos Mavrogiannopoulos [Fri, 12 Jul 2024 14:44:21 +0000 (14:44 +0000)]
Merge branch 'tmp-wintun-long-names' into 'master'

Increase adapter name to the maximum size allowed by Wintun

See merge request openconnect/openconnect!561

9 months agoMerge branch 'empt-resp-log' into 'master'
Nikos Mavrogiannopoulos [Fri, 12 Jul 2024 14:40:54 +0000 (14:40 +0000)]
Merge branch 'empt-resp-log' into 'master'

http: print proper log message on empty response

See merge request openconnect/openconnect!562

9 months agoAdded test with all non-ASCII chars
Marios Paouris [Wed, 3 Jul 2024 05:51:33 +0000 (08:51 +0300)]
Added test with all non-ASCII chars

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
9 months agoIncrease adapter name to the maximum size allowed by Wintun
Marios Paouris [Fri, 21 Jun 2024 07:43:54 +0000 (10:43 +0300)]
Increase adapter name to the maximum size allowed by Wintun

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
9 months agoVerbose reporting on reading adapter name failure. Added test to exercise wintun...
Marios Paouris [Mon, 17 Jun 2024 06:10:03 +0000 (09:10 +0300)]
Verbose reporting on reading adapter name failure. Added test to exercise wintun max adapter name

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
9 months agoMerge branch '20240614-comment-fix' into 'master'
Nikos Mavrogiannopoulos [Sun, 30 Jun 2024 20:05:53 +0000 (20:05 +0000)]
Merge branch '20240614-comment-fix' into 'master'

auth.c: minor fix in comment

See merge request openconnect/openconnect!555

10 months agohttp: print proper log message on empty response
Simon Ser [Tue, 25 Jun 2024 16:14:13 +0000 (18:14 +0200)]
http: print proper log message on empty response

The same log message was used for both an error HTTP status and an
empty HTTP response. Use different messages for each case.

Signed-off-by: Simon Ser <contact@emersion.fr>
10 months agoAdded wintun.h and Makefile.dlldeps on distribution
Marios Paouris [Mon, 17 Jun 2024 13:43:46 +0000 (16:43 +0300)]
Added wintun.h and Makefile.dlldeps on distribution

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
10 months agoauth.c: minor fix in comment
Antonio Borneo [Sat, 15 Jun 2024 12:21:25 +0000 (14:21 +0200)]
auth.c: minor fix in comment

The xml value of waiturl is saved in vpninfo->csd_waiturl.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
10 months agoMerge branch 'pschyska' into 'master'
Nikos Mavrogiannopoulos [Wed, 5 Jun 2024 18:24:26 +0000 (18:24 +0000)]
Merge branch 'pschyska' into 'master'

Initialize 'vpninfo->authgroup' to allow 'xmlpost_initial_req' to set '<group-select>'

See merge request openconnect/openconnect!554

10 months agoInitialize 'vpninfo->authgroup' to allow 'xmlpost_initial_req' to set '<group-select>'
Paul Schyska [Thu, 28 Mar 2024 18:57:30 +0000 (19:57 +0100)]
Initialize 'vpninfo->authgroup' to allow 'xmlpost_initial_req' to set '<group-select>'

Signed-off-by: Paul Schyska <pschyska@gmail.com>
11 months agoMerge branch 'tmp-reenable-ci' into 'master'
Nikos Mavrogiannopoulos [Fri, 10 May 2024 20:05:49 +0000 (20:05 +0000)]
Merge branch 'tmp-reenable-ci' into 'master'

.gitlab-ci.yml: use saas-linux-small-amd64 as tag

See merge request openconnect/openconnect!552

11 months ago.gitlab-ci.yml: use saas-linux-small-amd64 as tag
Nikos Mavrogiannopoulos [Fri, 10 May 2024 18:29:44 +0000 (20:29 +0200)]
.gitlab-ci.yml: use saas-linux-small-amd64 as tag

The linux and shared tags are deprecated:
https://docs.gitlab.com/ee/update/deprecations.html?removal_milestone=17.0#removal-of-tags-from-small-saas-runners-on-linux

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
12 months agoMerge branch 'Fedora_ppp-over-tls' into 'master'
David Woodhouse [Fri, 5 Apr 2024 10:07:08 +0000 (10:07 +0000)]
Merge branch 'Fedora_ppp-over-tls' into 'master'

Verbose logs to debug and fix ppp-over-tls

Closes #720

See merge request openconnect/openconnect!548

12 months agoVerbose socat logs for debugging, Add '-4' to listen on Legacy IP (for sockwrap)
Dimitri Papadopoulos Orfanos [Mon, 1 Apr 2024 13:58:56 +0000 (15:58 +0200)]
Verbose socat logs for debugging, Add '-4' to listen on Legacy IP (for sockwrap)

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
12 months agoMerge branch 'LOAD_LIBRARY_SEARCH_SYSTEM32' into 'master'
Dimitri Papadopoulos Orfanos [Sun, 31 Mar 2024 11:32:29 +0000 (11:32 +0000)]
Merge branch 'LOAD_LIBRARY_SEARCH_SYSTEM32' into 'master'

Search wintun.dll in the application directory only

See merge request openconnect/openconnect!541

13 months agoDon't package extra installed files for mingw rpms
Marios Paouris [Mon, 26 Feb 2024 19:17:45 +0000 (21:17 +0200)]
Don't package extra installed files for mingw rpms

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
13 months agoSearch wintun.dll in the application directory only
Dimitri Papadopoulos [Wed, 28 Feb 2024 06:31:00 +0000 (07:31 +0100)]
Search wintun.dll in the application directory only

Now that wintun.dll is installed in the application directory by
both openconnect and openconnect-gui packages, we can get rid of
LOAD_LIBRARY_SEARCH_SYSTEM32.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
13 months agoMerge branch 'rekey' into master
Daniel Lenski [Wed, 28 Feb 2024 05:42:32 +0000 (21:42 -0800)]
Merge branch 'rekey' into master

Fix logging of rekey / trojan invocation delay

See merge request openconnect/openconnect!539

13 months agoUpdate changelog
Daniel Lenski [Tue, 27 Feb 2024 23:39:53 +0000 (15:39 -0800)]
Update changelog

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
13 months agoFix logging of rekey / trojan invocation delay
Wade Cline [Wed, 28 Feb 2024 03:19:00 +0000 (19:19 -0800)]
Fix logging of rekey / trojan invocation delay

Closes #677

The rekey / trojan invocation is supposed to happen in the future.
Therefore subtract current time from expected time of rekey / invocation,
not the reverse.

These delays have been shown incorrectly ever since the SIGUSR1 handler was
added in b156b581e894b03e7169827b9e293ca2f13e1366.

Originally submitted at
https://lists.infradead.org/pipermail/openconnect-devel/2024-February/005400.html

Signed-off-by: Cline, Wade <wade.cline@intel.com>
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
13 months agoMerge branch 'tmp-build-mingw' into 'master'
Daniel Lenski [Sun, 25 Feb 2024 19:13:39 +0000 (19:13 +0000)]
Merge branch 'tmp-build-mingw' into 'master'

MinGW build improvements

See merge request openconnect/openconnect!537

13 months agoMinGW build improvements
Marios Paouris [Thu, 22 Feb 2024 10:03:01 +0000 (12:03 +0200)]
MinGW build improvements

- Decoupled wintun and vpnc-script-win.js from building installer.
- Added required dependencies for downloading wintun and vpnc-script-win.js.
- Install wintun, vpnc-script-win.js and list-system-keys by default.
- Added configure option to disable building installer (doesn't work in
  msys/mingw builds, can also speedup build when no installer required).

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
14 months agoMerge branch 'tmp-fix-openssl-3.0.6' into 'master'
Daniel Lenski [Thu, 22 Feb 2024 22:15:20 +0000 (22:15 +0000)]
Merge branch 'tmp-fix-openssl-3.0.6' into 'master'

Fix compatibility with openssl 3.1 and later versions

See merge request openconnect/openconnect!536

14 months agoUpdate changelog
Daniel Lenski [Thu, 22 Feb 2024 21:58:48 +0000 (13:58 -0800)]
Update changelog

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoopenssl-dtls: use DTLS 1.2 for PSK-NEGOTIATE
Nikos Mavrogiannopoulos [Wed, 21 Feb 2024 21:24:56 +0000 (22:24 +0100)]
openssl-dtls: use DTLS 1.2 for PSK-NEGOTIATE

Avoid reducing the security level for PSK-NEGOTIATE by
setting DTLS 1.2. This works well because all PSK-NEGOTIATE
ocserv servers are using gnutls that supports DTLS 1.2.

This addresses a previously undetermined issue with DTLS on centos7.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
14 months ago.gitlab-ci.yml: use fedora39 for all builds
Nikos Mavrogiannopoulos [Wed, 21 Feb 2024 20:59:20 +0000 (21:59 +0100)]
.gitlab-ci.yml: use fedora39 for all builds

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
14 months agoopenssl-dtls: set security level to zero when negotiating DTLS 1.0 or earlier
Nikos Mavrogiannopoulos [Wed, 21 Feb 2024 20:56:03 +0000 (21:56 +0100)]
openssl-dtls: set security level to zero when negotiating DTLS 1.0 or earlier

This addresses the issue of openssl 3.1 running in fedora39.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoMerge branch 'tmp-fix-dtls-disable' into 'master'
Nikos Mavrogiannopoulos [Wed, 21 Feb 2024 20:01:22 +0000 (20:01 +0000)]
Merge branch 'tmp-fix-dtls-disable' into 'master'

openconnect_disable_dtls: allow disabling DTLS unless already connected

Closes #697

See merge request openconnect/openconnect!523

14 months agoopenconnect_disable_dtls: allow disabling DTLS unless already connected
Nikos Mavrogiannopoulos [Thu, 11 Jan 2024 13:07:37 +0000 (14:07 +0100)]
openconnect_disable_dtls: allow disabling DTLS unless already connected

The openconnect client disables DTLS if it fails to
connect. Openconnect-gui couldn't do that because of
the restrictions of openconnect_disable_dtls(). This
MR removes those restrictions and allows disabling DTLS
even if we attempted connection before.

Resolves: #697

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
14 months agoMerge branch 'priority' into 'master'
Daniel Lenski [Tue, 20 Feb 2024 19:27:59 +0000 (19:27 +0000)]
Merge branch 'priority' into 'master'

GlobalProtect: Add priority-rule set support

Closes #663

See merge request openconnect/openconnect!498

14 months agoUpdate changelog
Daniel Lenski [Sat, 30 Sep 2023 04:36:37 +0000 (21:36 -0700)]
Update changelog

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoModify `fake-gp-server.py` to add regionalized priority-rules to the gateway list
Daniel Lenski [Fri, 29 Sep 2023 20:51:07 +0000 (13:51 -0700)]
Modify `fake-gp-server.py` to add regionalized priority-rules to the gateway list

The fake GP server will now assign the connecting user to a random planet in
its portal prelogin response, then randomly and haphazardly prioritize the
gateways by planet.

For example, start fake-gp-server.py, then configure it with 3 gateways:

    $ curl -k https://localhost:8080/CONFIGURE -d gateways=Red,Orange,Yellow
    $ curl -k https://localhost:8080/CONFIGURE
    Current configuration of fake GP server configuration:
    TestConfiguration(gateways=['Red', 'Orange', 'Yellow'], ...)

Then attempt to connect to it:

    $ openconnect --protocol=gp --dump-http-traffic localhost:8080
    ...
    Greetings, user from MERCURY. Please login to this fake GP VPN portal
    Username: bar
    Password:
    POST https://localhost:8080/global-protect/getconfig.esp
    ...
    < <?xml version="1.0" encoding="UTF-8" ?>
    < <policy><version> 6.7.8-9 </version><gateways><external><list>
    < <entry name="localhost:8080">
    <   <description>Red</description>
    <   <priority-rule>
    <     <entry name="VENUS"><priority>1</priority></entry>
    <     <entry name="Any"><priority>99</priority></entry>
    <   </priority-rule>
    < </entry>
    < <entry name="localhost:8080">
    <   <description>Orange</description>
    <   <priority-rule>
    <     <entry name="JUPITER"><priority>2</priority></entry>
    <     <entry name="MARS"><priority>1</priority></entry>
    <   </priority-rule>
    < </entry>
    < <entry name="localhost:8080">
    <   <description>Yellow</description>
    <   <priority-rule>
    <     <entry name="MERCURY"><priority>1</priority></entry>
    <     <entry name="EARTH"><priority>2</priority></entry>
    <   </priority-rule>
    < </entry></list>
    < </external></gateways>
    < <hip-collection><hip-report-interval>600</hip-report-interval></hip-collection>
    < </policy>
    Portal reports GlobalProtect version 6.7.8-9; we will report the same client version.
    Portal set HIP report interval to 10 minutes).
    5 gateway servers available:
      Red (localhost:8080) [priority 99]
      Orange (localhost:8080) [unprioritized]
      Yellow (localhost:8080) [priority 1]
    Please select GlobalProtect gateway.
    GATEWAY: [Yellow|Red|Orange]:

Note that the gateways are now presented to the user in the priority order
for the user's "region" of MERCURY.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoGlobalProtect: Add priority-rule set support
Jan-Michael Brummer [Thu, 28 Sep 2023 17:46:32 +0000 (19:46 +0200)]
GlobalProtect: Add priority-rule set support

Starting from version 8.0, PAN GlobalProtect portal servers are able to send
a priority rule list for each gateway.  Per
https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClSsCAK,
the gateways can be prioritized by geographic region.

The gateways should then be presented to the user in order of geographic
priority, rather than just in their order of appearance in
policy/gateways/external/list (from the portal config XML).

How does the client know which geographic region it is in?

1. The client itself may have some way to figure out which region it is
   connecting from (e.g. geolocation, not implemented yet for OpenConnect).
2. The client may have an option to explicitly specifiy the desired region
   (not implemented yet in OpenConnect).
3. The *server* tells the client which region it thinks the client is
   connecting from, in the portal *prelogin* response, and the client
   follows that (implemented here).

Fixes: https://gitlab.com/openconnect/openconnect/-/issues/663
[DRL fixed a small mistake in qsort usage, and tweaked code structure,
comments, and log messages.]

Signed-off-by: Jan-Michael Brummer <jan-michael.brummer1@volkswagen.de>
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoMerge branch 'fix_gp_IPv6_split_include' into 'master'
Daniel Lenski [Tue, 20 Feb 2024 06:14:03 +0000 (22:14 -0800)]
Merge branch 'fix_gp_IPv6_split_include' into 'master'

14 months agoUpdate changelog
Daniel Lenski [Tue, 20 Feb 2024 06:12:20 +0000 (22:12 -0800)]
Update changelog

This bug in GlobalProtect IPv6 split-include handling was introduced in
https://gitlab.com/openconnect/openconnect/-/commit/a2b8134edf8e5f8e942dedf105e2813a0824b919;
see also
https://gitlab.com/openconnect/openconnect/-/merge_requests/367#note_1780223796.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoFix GlobalProtect config-parsing bug that misidentified IPv6 split-include routes...
Daniel Loxtermann [Tue, 20 Feb 2024 01:59:47 +0000 (17:59 -0800)]
Fix GlobalProtect config-parsing bug that misidentified IPv6 split-include routes as split-exclude

As reported on the mailing list at
https://lists.infradead.org/pipermail/openconnect-devel/2024-January/005386.html,
the relevant code wasn't handling the IPv6 case correctly.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoSend 'cas-support=yes' in GlobalProtect prelogin request
Daniel Lenski [Mon, 25 Sep 2023 14:14:37 +0000 (07:14 -0700)]
Send 'cas-support=yes' in GlobalProtect prelogin request

Per https://gitlab.com/openconnect/openconnect/-/issues/651, some newer GP
servers are responding to prelogin.esp requests with an error:

    CAS is not supported by the client.  Minimum client version is 6.0

It appears that CAS ("Central Authentication Server";
https://apereo.github.io/cas/index.html) is a standardized single-sign-on
protocol requiring an external browser.

Per https://gitlab.com/openconnect/openconnect/-/issues/651#note_1576596243,
the field 'cas-support=yes' needs to be sent in the POST *body* of the
prelogin request, in order to avoid this error message; the error message's
claim that a specific client software version is necessary isn't very
helpful.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoReal GlobalProtect SAML authentication forms won't work without JavaScript
Daniel Lenski [Tue, 26 Sep 2023 19:08:45 +0000 (12:08 -0700)]
Real GlobalProtect SAML authentication forms won't work without JavaScript

This adds a 'saml_needs_js' option to fake-gp-server.py.  If set, the fake
SAML login form that it generates won't work correctly without JavaScript
execution, just like a "real" GlobalProtect SAML server.

See 64a0ba69e53d065f4d2ba4e89e6ff10926d6c895 for the use case for this fake
SAML authentication endpoint.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
14 months agoMerge branch 'JScript' into 'master'
Dimitri Papadopoulos Orfanos [Sat, 10 Feb 2024 13:20:34 +0000 (13:20 +0000)]
Merge branch 'JScript' into 'master'

Force the Windows script host to use the JScript engine

Closes #703

See merge request openconnect/openconnect!534

14 months agoMerge branch 'xmlstarlet' into 'master'
Dimitri Papadopoulos Orfanos [Mon, 5 Feb 2024 07:42:16 +0000 (07:42 +0000)]
Merge branch 'xmlstarlet' into 'master'

Force final newline in xmlstarlet

See merge request openconnect/openconnect!535

14 months agoForce final newline in xmlstarlet
Jon DeVree [Sat, 3 Feb 2024 17:09:58 +0000 (12:09 -0500)]
Force final newline in xmlstarlet

By default xmlstarlet does not include a final newline on the output.
Because POSIX says that all lines must end in a newline, this causes the
final line of output to be skipped by the 'while read ...' loop in bash.
Adding a '-n' after the '-v ...' causes xmlstarlet to include a final
newline at the end of its output.

Signed-off-by: Jon DeVree <nuxi@vault24.org>
14 months agoForce the Windows script host to use the JScript engine
Dimitri Papadopoulos Orfanos [Fri, 2 Feb 2024 10:31:50 +0000 (11:31 +0100)]
Force the Windows script host to use the JScript engine

This bypasses rogue programs that register as handlers
for the ".js" file extension but fail to run the script.

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
14 months agoMerge branch 'gcc14-fix' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 31 Jan 2024 09:04:17 +0000 (09:04 +0000)]
Merge branch 'gcc14-fix' into 'master'

Fix implicit declaration of function 'malloc'

See merge request openconnect/openconnect!533

Signed-off-by: default avatarBrahmajit Das <brahmajit.xyz@gmail.com>