]> www.infradead.org Git - users/dwmw2/openconnect.git/log
users/dwmw2/openconnect.git
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>
14 months agoMerge branch 'main' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 31 Jan 2024 08:59:26 +0000 (08:59 +0000)]
Merge branch 'main' into 'master'

main() signature compliant with C standard

See merge request openconnect/openconnect!516

14 months agoMerge branch 'tmp-external-browser' into 'master'
Nikos Mavrogiannopoulos [Wed, 31 Jan 2024 08:48:05 +0000 (08:48 +0000)]
Merge branch 'tmp-external-browser' into 'master'

configure.ac: print external browser and vpnc script

See merge request openconnect/openconnect!531

14 months agoMove <stdlib.h> around, match existing ordering
Dimitri Papadopoulos [Wed, 31 Jan 2024 08:39:17 +0000 (09:39 +0100)]
Move <stdlib.h> around, match existing ordering

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
14 months agoFix implicit declaration of function 'malloc'
Brahmajit Das [Mon, 29 Jan 2024 17:58:53 +0000 (23:28 +0530)]
Fix implicit declaration of function 'malloc'

First observed on Gentoo Linux with GCC 14. This is due to GCC 14
enabling -Werror=implicit-function-declaration by default.
Thus resulting in errors such as:

openconnect-internal.h: In function 'alloc_pkt':
openconnect-internal.h:911:27: error: implicit declaration of function 'malloc' [-Werror=implicit-function-declaration]
  911 |         struct pkt *pkt = malloc(alloc_len);
      |                           ^~~~~~

Plese refer gentoo bug: https://bugs.gentoo.org/923173
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
14 months agoImport translations from GNOME
David Woodhouse [Mon, 29 Jan 2024 17:46:01 +0000 (09:46 -0800)]
Import translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
14 months agoMerge branch 'AppVeyor' into 'master'
Dimitri Papadopoulos Orfanos [Mon, 29 Jan 2024 16:10:18 +0000 (16:10 +0000)]
Merge branch 'AppVeyor' into 'master'

Fix compiler warnings when buliding on AppVeyor

See merge request openconnect/openconnect!532

14 months agoFix compiler warnings when buliding on AppVeyor
Dimitri Papadopoulos Orfanos [Sun, 28 Jan 2024 19:43:03 +0000 (20:43 +0100)]
Fix compiler warnings when buliding on AppVeyor

../mtucalc.c: In function 'calculate_mtu':
../mtucalc.c:75:33: warning: passing argument 4 of 'getsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
   75 |                                 &mss, &mss_size)) {
      |                                 ^~~~
      |                                 |
      |                                 int *
In file included from ../openconnect-internal.h:31,
                 from ../mtucalc.c:20:
C:/msys64/mingw64/include/winsock2.h:1010:82: note: expected 'char *' but argument is of type 'int *'
 1010 |   WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen);
      |                                                                            ~~~~~~^~~~~~
  CC       libopenconnect_la-lzo.lo

../cstp.c: In function 'calculate_dtls_mtu':
../cstp.c:134:33: warning: passing argument 4 of 'getsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
  134 |                                 &mss, &mss_size)) {
      |                                 ^~~~
      |                                 |
      |                                 int *
In file included from ../openconnect-internal.h:31,
                 from ../cstp.c:21:
C:/msys64/mingw64/include/winsock2.h:1010:82: note: expected 'char *' but argument is of type 'int *'
 1010 |   WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen);
      |                                                                            ~~~~~~^~~~~~

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
14 months agoconfigure.ac: print external browser and vpnc script
Nikos Mavrogiannopoulos [Sat, 27 Jan 2024 09:55:03 +0000 (10:55 +0100)]
configure.ac: print external browser and vpnc script

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agoMerge branch 'openconnect-gui' into 'master'
Nikos Mavrogiannopoulos [Thu, 25 Jan 2024 08:28:43 +0000 (08:28 +0000)]
Merge branch 'openconnect-gui' into 'master'

Update URL of OpenConnect-gui home page

See merge request openconnect/openconnect!530

15 months agoUpdate URL of OpenConnect-gui home page
Dimitri Papadopoulos Orfanos [Thu, 25 Jan 2024 08:12:00 +0000 (09:12 +0100)]
Update URL of OpenConnect-gui home page

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agoMerge branch 'mingw-test-fix' into 'master'
Nikos Mavrogiannopoulos [Sun, 21 Jan 2024 09:17:43 +0000 (09:17 +0000)]
Merge branch 'mingw-test-fix' into 'master'

Added WINEPATH to fix MinGW CI tests

Closes #689

See merge request openconnect/openconnect!529

15 months agoAdded WINEPATH to fix MinGW CI tests
Marios Paouris [Sat, 20 Jan 2024 08:43:12 +0000 (10:43 +0200)]
Added WINEPATH to fix MinGW CI tests

Signed-off-by: Marios Paouris <mspaourh@gmail.com>
15 months agoMerge branch 'fortinet_chunk-size' into 'master'
Dimitri Papadopoulos Orfanos [Fri, 19 Jan 2024 10:54:31 +0000 (10:54 +0000)]
Merge branch 'fortinet_chunk-size' into 'master'

Be lenient when parsing HTTP chunk-size

Closes #698

See merge request openconnect/openconnect!524

15 months agoMerge branch 'tmp-nsi-merge' into 'master'
Nikos Mavrogiannopoulos [Fri, 19 Jan 2024 05:18:07 +0000 (05:18 +0000)]
Merge branch 'tmp-nsi-merge' into 'master'

nsis: create a self-contained nsi file

See merge request openconnect/openconnect!522

15 months agomain() signature compliant with C standard
Dimitri Papadopoulos Orfanos [Fri, 29 Dec 2023 10:58:21 +0000 (11:58 +0100)]
main() signature compliant with C standard

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agoMerge branch 'report-android-as-android' into 'master'
Nikos Mavrogiannopoulos [Thu, 18 Jan 2024 05:01:17 +0000 (05:01 +0000)]
Merge branch 'report-android-as-android' into 'master'

Correctly report Android and iOS for globalprotect

See merge request openconnect/openconnect!527

15 months agoCorrectly report Android and iOS for globalprotect
Art Pinch [Tue, 16 Jan 2024 17:37:06 +0000 (20:37 +0300)]
Correctly report Android and iOS for globalprotect

Signed-off-by: Art Pinch <leonardo906@mail.ru>
15 months agoMerge branch 'tmp-latest-fedora' into 'master'
Nikos Mavrogiannopoulos [Mon, 15 Jan 2024 16:55:19 +0000 (16:55 +0000)]
Merge branch 'tmp-latest-fedora' into 'master'

Run openconnect on latest fedora (39)

See merge request openconnect/openconnect!504

15 months agoUse latest fedora (39) for CI
Nikos Mavrogiannopoulos [Tue, 21 Nov 2023 14:09:53 +0000 (15:09 +0100)]
Use latest fedora (39) for CI

This moves all CI images to Fedora39 except OpenSSL builds
that still use Fedora38 due to compatibility issues.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agoBe lenient when parsing HTTP chunk-size
Dimitri Papadopoulos Orfanos [Fri, 12 Jan 2024 16:15:10 +0000 (17:15 +0100)]
Be lenient when parsing HTTP chunk-size

Fortinet servers appear to be abusing RFC 9112:

     chunk          = chunk-size [ chunk-ext ] CRLF
                      chunk-data CRLF

     chunk-size     = 1*HEXDIG

     chunk-ext      = *( BWS ";" BWS chunk-ext-name
                         [ BWS "=" BWS chunk-ext-val ] )

They add spaces (BWS) at the end of chunk-size, even in the absence of chunk-ext.

Be lenient when parsing chunk:
1. Accept bogus chunk-ext, with ";" not followed by chunk-ext-name.
2. Discard leading/trailing spaces in chunk-size, strtol() will do that for us.

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agonsis: create self-contained nsi file
Nikos Mavrogiannopoulos [Wed, 10 Jan 2024 19:51:37 +0000 (20:51 +0100)]
nsis: create self-contained nsi file

Including from a relative path is interpreted differently
depending on where the caller is started. This allows running
nsis on the output nsi even if not located at the build directory.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agoMerge branch 'nsis_keywords' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 21:42:08 +0000 (21:42 +0000)]
Merge branch 'nsis_keywords' into 'master'

Avoid warnings while building the NSIS installer

See merge request openconnect/openconnect!513

15 months agoMerge branch 'bad_dtls_test' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 21:27:50 +0000 (21:27 +0000)]
Merge branch 'bad_dtls_test' into 'master'

bad_dtls_test: set security level to 0

See merge request openconnect/openconnect!478

15 months agoAvoid warnings while building the NSIS installer
Dimitri Papadopoulos Orfanos [Fri, 22 Dec 2023 10:53:18 +0000 (11:53 +0100)]
Avoid warnings while building the NSIS installer

warning 9100: Generating version information for language
              "1033-English" without standard key "FileVersion"
warning 9100: Generating version information for language
              "1033-English" without standard key "FileDescription"

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agoMerge branch 'bugfix/win-external-browser-flag' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 20:40:09 +0000 (20:40 +0000)]
Merge branch 'bugfix/win-external-browser-flag' into 'master'

Support --external-browser flag on _WIN32 systems

See merge request openconnect/openconnect!489

15 months agoMerge branch 'libxml/parser' into 'master'
Dimitri Papadopoulos Orfanos [Sat, 6 Jan 2024 20:16:42 +0000 (20:16 +0000)]
Merge branch 'libxml/parser' into 'master'

Include <libxml/tree.h> from a single place

See merge request openconnect/openconnect!507

15 months agoMerge branch 'tmp-android-fixes' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 18:16:00 +0000 (18:16 +0000)]
Merge branch 'tmp-android-fixes' into 'master'

.gitlab-ci.yml: specify the toolchain image used

See merge request openconnect/openconnect!520

15 months agoInclude <libxml/tree.h> from a single place
Dimitri Papadopoulos Orfanos [Sat, 6 Jan 2024 15:48:28 +0000 (16:48 +0100)]
Include <libxml/tree.h> from a single place

<libxml/tree.h> used to be included both by "openconnect-internal.h"
and from *.c source files. We don't need both. Let's settle on including
from "openconnect-internal.h" only.

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months ago.gitlab-ci.yml: specify the toolchain image used
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 15:38:46 +0000 (16:38 +0100)]
.gitlab-ci.yml: specify the toolchain image used

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agoMerge branch 'stricter_chunked_encoding_error_detection' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 12:11:27 +0000 (12:11 +0000)]
Merge branch 'stricter_chunked_encoding_error_detection' into 'master'

Stricter chunked-encoding error detection

See merge request openconnect/openconnect!468

15 months agoMerge branch 'asctime_newline' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 12:06:05 +0000 (12:06 +0000)]
Merge branch 'asctime_newline' into 'master'

Remove trailing new line returned by ctime()

Closes #598

See merge request openconnect/openconnect!469

15 months agoMerge branch 'change_default_UA_string_to_be_compatible_with_newer_Cisco_servers...
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 10:39:30 +0000 (10:39 +0000)]
Merge branch 'change_default_UA_string_to_be_compatible_with_newer_Cisco_servers' into 'master'

Change default user-agent string to be compatible with newer Cisco servers

Closes #544, #593, #602, #618, #635, #657, #662, and #665

See merge request openconnect/openconnect!497

15 months agoMerge branch 'reading' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 10:34:38 +0000 (10:34 +0000)]
Merge branch 'reading' into 'master'

Get rid of repeated "reading" in comment

See merge request openconnect/openconnect!510

15 months agoMerge branch 'mailmap' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 10:32:41 +0000 (10:32 +0000)]
Merge branch 'mailmap' into 'master'

Update .mailmap

See merge request openconnect/openconnect!512

15 months agoMerge branch 'doc_vpnc-script' into 'master'
Nikos Mavrogiannopoulos [Sat, 6 Jan 2024 10:29:30 +0000 (10:29 +0000)]
Merge branch 'doc_vpnc-script' into 'master'

Remove extraneous period from the documentation

See merge request openconnect/openconnect!515

15 months agoMerge branch 'tmp-update-uris' into 'master'
Dimitri Papadopoulos Orfanos [Fri, 5 Jan 2024 23:43:06 +0000 (23:43 +0000)]
Merge branch 'tmp-update-uris' into 'master'

www: updated links to ocserv web pages

See merge request openconnect/openconnect!517

15 months agoMerge branch 'mingw-fix' into 'master'
Dimitri Papadopoulos Orfanos [Fri, 5 Jan 2024 22:44:32 +0000 (22:44 +0000)]
Merge branch 'mingw-fix' into 'master'

use the unsigned printf qualifier for size_t : fixes MinGW{32,64} build

See merge request openconnect/openconnect!506

15 months agoMerge branch 'bugfix/cstp_sso_detect_done' into 'master'
Dimitri Papadopoulos Orfanos [Fri, 5 Jan 2024 22:41:04 +0000 (22:41 +0000)]
Merge branch 'bugfix/cstp_sso_detect_done' into 'master'

cstp: Check if uri is NULL in sso_detect_done

See merge request openconnect/openconnect!511

15 months agoRemove extraneous period from the documentation
Dimitri Papadopoulos Orfanos [Mon, 25 Dec 2023 19:47:41 +0000 (20:47 +0100)]
Remove extraneous period from the documentation

Be consistent, other ttles don't end with a period.

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agoMerge branch 'xmlReadMemory' into 'master'
Dimitri Papadopoulos Orfanos [Fri, 5 Jan 2024 22:38:31 +0000 (22:38 +0000)]
Merge branch 'xmlReadMemory' into 'master'

include <libxml/parser.h> : fix xmlReadMemory build error

Closes #685

See merge request openconnect/openconnect!505

15 months agoUpdate .mailmap
Dimitri Papadopoulos [Fri, 22 Dec 2023 10:43:23 +0000 (11:43 +0100)]
Update .mailmap

One more address to consolidate

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agoGet rid of repeated "reading" in comment
Dimitri Papadopoulos [Sun, 17 Dec 2023 17:23:49 +0000 (18:23 +0100)]
Get rid of repeated "reading" in comment

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
15 months agowww: updated links to ocserv web pages
Nikos Mavrogiannopoulos [Fri, 5 Jan 2024 15:49:25 +0000 (16:49 +0100)]
www: updated links to ocserv web pages

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agoMerge branch 'tmp-skip-mingw-failures' into 'master'
Nikos Mavrogiannopoulos [Fri, 5 Jan 2024 22:20:04 +0000 (22:20 +0000)]
Merge branch 'tmp-skip-mingw-failures' into 'master'

Avoid mingw/openssl failures

See merge request openconnect/openconnect!518

15 months ago.gitlab-ci.yml: make bad_dtls_test XFAIL in fedora mingw
Nikos Mavrogiannopoulos [Fri, 5 Jan 2024 18:17:17 +0000 (19:17 +0100)]
.gitlab-ci.yml: make bad_dtls_test XFAIL in fedora mingw

This makes the CI not failing, allowing to bring new patches.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
15 months agowintun: Use it from the CI image when available
Nikos Mavrogiannopoulos [Fri, 5 Jan 2024 19:49:05 +0000 (20:49 +0100)]
wintun: Use it from the CI image when available

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
16 months agocstp: Check if uri is NULL in sso_detect_done
Rahul Rameshbabu [Thu, 21 Dec 2023 20:46:08 +0000 (12:46 -0800)]
cstp: Check if uri is NULL in sso_detect_done

Passing a NULL value to strcmp is undefined behavior. Some web engines
might have events where cookies are enumerated, but the event does not
contain a uri enumeration. An example is QtWebEngine where it has discrete
signals, QWebEngineView::urlChanged and QWebEngineCookieStore::cookieAdded.
Add a check similar to the one found in gpst_sso_detect_done for the uri
member of struct oc_webview_result.

Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
16 months agoMerge branch 'bugfix/cstp_sso_detect_done' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 13 Dec 2023 23:03:37 +0000 (23:03 +0000)]
Merge branch 'bugfix/cstp_sso_detect_done' into 'master'

cstp: Check if cookies is NULL in sso_detect_done

See merge request openconnect/openconnect!449

16 months agoMerge branch 'cscript' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 13 Dec 2023 23:00:42 +0000 (23:00 +0000)]
Merge branch 'cscript' into 'master'

Remove spurious "cscript "

See merge request openconnect/openconnect!491

16 months agoMerge branch 'script_setenv_NULL' into 'master'
Dimitri Papadopoulos Orfanos [Wed, 13 Dec 2023 20:56:34 +0000 (20:56 +0000)]
Merge branch 'script_setenv_NULL' into 'master'

script_setenv: fix append with val == NULL

See merge request openconnect/openconnect!445

16 months agoscript_setenv: fix append with val == NULL
Dimitri Papadopoulos Orfanos [Wed, 13 Dec 2023 20:56:34 +0000 (20:56 +0000)]
script_setenv: fix append with val == NULL

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
16 months agouse the unsigned printf qualifier for size_t : fixes MinGW{32,64} build
Timothee 'TTimo' Besset [Sun, 26 Nov 2023 16:13:05 +0000 (10:13 -0600)]
use the unsigned printf qualifier for size_t : fixes MinGW{32,64} build

Signed-off-by: Timothee Besset <ttimo@ttimo.net>
16 months agoinclude <libxml/parser.h> : fix xmlReadMemory build error
Timothee 'TTimo' Besset [Sun, 26 Nov 2023 14:34:21 +0000 (08:34 -0600)]
include <libxml/parser.h> : fix xmlReadMemory build error

Signed-off-by: Timothee Besset <ttimo@ttimo.net>
17 months agoMerge branch 'coverity_fixes' into 'master'
Dimitri Papadopoulos Orfanos [Thu, 9 Nov 2023 13:05:28 +0000 (13:05 +0000)]
Merge branch 'coverity_fixes' into 'master'

Fix assorted Coverity Scan issues

See merge request openconnect/openconnect!502

17 months agoFix resource leak identified by Coverity Scan
Dimitri Papadopoulos [Mon, 6 Nov 2023 12:52:59 +0000 (13:52 +0100)]
Fix resource leak identified by Coverity Scan

Isn't it possible that gpst_xml_or_error(), called by gpst_login(),
is called twice?

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
17 months agoFix dead code identified by Coverity Scan
Dimitri Papadopoulos [Mon, 6 Nov 2023 11:10:24 +0000 (12:10 +0100)]
Fix dead code identified by Coverity Scan

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
17 months agoFix resource leak identified by Coverity Scan
Dimitri Papadopoulos [Mon, 6 Nov 2023 11:07:37 +0000 (12:07 +0100)]
Fix resource leak identified by Coverity Scan

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
18 months agoGet rid of non-reentrant functions
Dimitri Papadopoulos [Tue, 25 Apr 2023 10:22:46 +0000 (13:22 +0300)]
Get rid of non-reentrant functions

Because we know the code in `main.c` is executed in a single-threaded
environment, we don't need to modify non-reentant functions in this file,
unless some linter complains in the future:
* localtime()
* getpwnam()

The only remaining non-entrant function is:
* getpwuid()

Using constant 2049 instead of sysconf(_SC_GETPW_R_SIZE_MAX) might not
be the best idea. I want to avoid dynamic allocation. On Ubuntu 18.04,
sysconf(_SC_GETPW_R_SIZE_MAX) is 1024, so 2049 "ought to be enough".

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
18 months agoGet rid of the trailing new line added by ctime()
Dimitri Papadopoulos [Mon, 24 Apr 2023 12:56:55 +0000 (15:56 +0300)]
Get rid of the trailing new line added by ctime()

From the POSIX documentation of ctime:
The ctime() function shall convert the time pointed to
by clock [...] to local time in the form of a string.
It shall be equivalent to:

        asctime(localtime(clock))

From the POSIX documentation of asctime:
The asctime() function shall convert the broken-down time
in the structure pointed to by timeptr into a string in the
form:

Sun Sep 16 01:03:52 1973\n\0

We need to get rid of that new line otherwise it appears in the log.

The POSIX documentation goes on:
These functions are included only for compatibility with older
implementations. They have undefined behavior if the resulting
string would be too long, so the use of these functions should
be discouraged. On implementations that do not detect output
string length overflow, it is possible to overflow the output
buffers in such a way as to cause applications to fail, or
possible system security violations. Also, these functions do
not support localized date and time formats. To avoid these
problems, applications should use strftime() to generate
strings from broken-down times.

Because we have already been using strftime() with gmtime() elsewhere,
using strftime() with locatime() here makes sense.

The i1On mechanisme we currently use to print dates is non-sensical:
we force the format string to "%a, %d %b %Y %H:%M:%S" which might not
make sense in some locales. We shall fix i10n in a different merge
request or commit.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
18 months agoRemove spurious "cscript "
Dimitri Papadopoulos [Thu, 31 Aug 2023 14:02:14 +0000 (17:02 +0300)]
Remove spurious "cscript "

Do not add "cscript " in main.c, instead rely on "cscript.exe " being
added in script.c.

This spurious "cscript " had been forgotten in f3b06b62.

Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
18 months agoChange default user-agent string to be compatible with newer Cisco servers
Daniel Lenski [Tue, 26 Sep 2023 22:29:48 +0000 (15:29 -0700)]
Change default user-agent string to be compatible with newer Cisco servers

See https://gitlab.com/openconnect/openconnect/-/issues/665 for a summary of
this issue.

This implements the simplest reasonable solution to the problem: Just Change
The Default™ UA string.

Short summary: Cisco did something stupidly backwards-incompatible in their
authentication flow.  It's hard to tell if it was due to incompetence or due
to malice towards unofficial clients
(https://gitlab.com/openconnect/openconnect/-/issues/635#note_1451782874)
but it doesn't really matter.

If merged, this should fix #544, #593, #602, #618, #635, #657, #662,
and #665.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
18 months agoBugfix GP XML config: always include portal
Daniel Lenski [Sat, 30 Sep 2023 05:02:33 +0000 (22:02 -0700)]
Bugfix GP XML config: always include portal

Ever since 8e7efd51f, the GlobalProtect *portal* has been included in the
newly-written XML config (`<ServerList>`) only if the portal config XML
contained a `<portal-name>` tag.

We should include the portal even if it doesn't have a name for itself.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
19 months agoGlobalProtect SAML completion pages sometimes have the SAML fields only in comments
Daniel Lenski [Fri, 22 Sep 2023 16:54:11 +0000 (09:54 -0700)]
GlobalProtect SAML completion pages sometimes have the SAML fields only in comments

This modifies the fake GP server to have a 'saml_comments_only' option.  If
set, the SAML completion fields ('saml-username', 'prelogin-cookie', etc.)
will be sent to the client *only* in a blob of XML wrapped in HTML comments,
and *not* in HTTP headers.

Some real GP servers are known to behave like this, and authentication
handlers like 'gp-saml-gui' need to be able to handle this case correctly
(see https://github.com/dlenski/gp-saml-gui/issues/51 and
https://github.com/dlenski/gp-saml-gui/pull/59).

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
19 months agoUpdate docs on implementing new protocols
Daniel Lenski [Sun, 10 Sep 2023 18:09:11 +0000 (11:09 -0700)]
Update docs on implementing new protocols

Signed-off-by: Daniel Lenski <dlenski@amazon.com>
19 months agoBump fallback GlobalProtect version number
Dimitri Papadopoulos [Sat, 9 Sep 2023 09:07:03 +0000 (12:07 +0300)]
Bump fallback GlobalProtect version number

Some GlobalProtect servers complain about old versions of the client
software connecting to them.

In the case of a connection via the GlobalProtect "portal" interface,
we capture the preferred software version from the portal and parrot it back,
as of https://gitlab.com/openconnect/openconnect/-/commit/c0d2daeaa85f69ed2f89330a53d97ae7eafdffb1?merge_request_iid=333.

However, we should update the GlobalProtect software version used as a fallback
in the case of a direct connection to the "gateway" interface.

Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
Signed-off-by: Daniel Lenski <dlenski@amazon.com>
19 months agoSupport --external-browser flag on _WIN32 systems
Rahul Rameshbabu [Sat, 19 Aug 2023 22:39:12 +0000 (15:39 -0700)]
Support --external-browser flag on _WIN32 systems

When external browser support for AnyConnect was added to _WIN32 platforms
in commit d4fc4b084748, the relevant flag in the CLI was not enabled for
the platform.

Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
19 months agoShim for renaming of GNUTLS_NO_EXTENSIONS in GnuTLS v3.8.1
Daniel Lenski [Tue, 22 Aug 2023 19:02:19 +0000 (12:02 -0700)]
Shim for renaming of GNUTLS_NO_EXTENSIONS in GnuTLS v3.8.1

The constant `GNUTLS_NO_EXTENSIONS` was renamed in
https://gitlab.com/gnutls/gnutls/-/commit/a7c4a04e (released in v3.8.1), and
then a backwards-compatibility shim was belatedly added in
https://gitlab.com/gnutls/gnutls/-/commit/abfa8634, which has not yet been
released.

We need to re-add the constant ourselves in order to build correctly with
GnuTLS v3.8.1.  This should fix
https://gitlab.com/openconnect/openconnect/-/issues/650.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
20 months agoMerge branch 'tmp-update-fedora-build' into 'master'
Nikos Mavrogiannopoulos [Tue, 22 Aug 2023 19:34:52 +0000 (19:34 +0000)]
Merge branch 'tmp-update-fedora-build' into 'master'

Update fedora build & add centos streams

See merge request openconnect/openconnect!485

20 months agoMerge branch 'tmp-enable-asan' into 'master'
Nikos Mavrogiannopoulos [Tue, 22 Aug 2023 19:34:08 +0000 (19:34 +0000)]
Merge branch 'tmp-enable-asan' into 'master'

Enable address sanitizer checks

See merge request openconnect/openconnect!486

20 months agoFix invalid reset of URL variable in csd-wrapper
Audric Schiltknecht [Wed, 2 Aug 2023 15:15:50 +0000 (15:15 +0000)]
Fix invalid reset of URL variable in csd-wrapper

The URL variable is constructed from the CSD_HOSTNAME at the beginning of
the script.  However, prior to parsing the command line, it was reset to
an empty value.

[DRL: This bug has existed since
https://gitlab.com/openconnect/openconnect/-/commit/cb83e535213ff2132643d2a68c50abc294b43b82,
when I modified the `csd-wrapper.sh` script to parse its `-url` command-line
argument, but forgot to remove the subsequent line `URL=`.]

Signed-off-by: Audric Schiltknecht <storm+gitlab@chemicalstorm.org>
21 months agoRequest help with the interpretation of F5 URIs in the docs
Daniel Lenski [Wed, 26 Jul 2023 20:41:15 +0000 (16:41 -0400)]
Request help with the interpretation of F5 URIs in the docs

Some F5 VPNs use these to complete authentication and handoff to the
proprietary client, and we currently don't know how to interpret them in a
way that would allow OpenConnect to be used instead.

See https://gitlab.com/openconnect/openconnect/-/issues/639 and
https://lists.infradead.org/pipermail/openconnect-devel/2021-August/005035.html
for further discussion.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoFix changelog entry for Pulse OS reporting
David Woodhouse [Tue, 25 Jul 2023 22:13:03 +0000 (23:13 +0100)]
Fix changelog entry for Pulse OS reporting

This was added under v9.12 instead of the HEAD section. Next person to do
that gets to implement a CI test for it :)

Perhaps we should have a policy of adding in reverse chronological order
so that newly-added lines are always immediately below the 'HEAD' title,
which would mean that merging older PRs would *conflict* instead of
silently merging into the older changelog?

Fixes: ff86be7281 ("update changelog")
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
21 months agoFix juniper-auth test
Daniel Lenski [Sun, 23 Jul 2023 17:18:09 +0000 (13:18 -0400)]
Fix juniper-auth test

In 57160c9f2673adbbe468db137b28da4187549061, I updated
fake-juniper-server.py to use a "persistent" configuration (as already done
for fake GlobalProtect, Fortinet, F5 servers), but thne I somehow forgot to
update the actual juniper-auth test script accordingly.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoReplace broken link with Wayback Machine link
Daniel Lenski [Wed, 19 Jul 2023 14:41:16 +0000 (07:41 -0700)]
Replace broken link with Wayback Machine link

The article "Why TCP Over TCP Is A Bad Idea" is very useful for explaining
why VPNs perform better when using UDP-based transport (DTLS or ESP) rather
than TCP-based transport (TLS), but unfortunately the original site is no
longer available.

Replace it with a link to the Internet Archive's Waback Machine, specifically
https://web.archive.org/web/20230228035749/http://sites.inka.de/~W1011/devel/tcp-tcp.html

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months ago.gitlab-ci.yml: enabled address sanitizer checks
Nikos Mavrogiannopoulos [Tue, 18 Jul 2023 10:37:31 +0000 (12:37 +0200)]
.gitlab-ci.yml: enabled address sanitizer checks

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
21 months ago.gitlab-ci.yml: added centos 8 and 9 stream builds
Nikos Mavrogiannopoulos [Tue, 18 Jul 2023 10:35:48 +0000 (12:35 +0200)]
.gitlab-ci.yml: added centos 8 and 9 stream builds

The --allow-insecure-crypto doesn't work with CentOS stream 9
and the openssl legacy provider.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
21 months agodecompress_and_queue_packet: removed dead assignment
Nikos Mavrogiannopoulos [Tue, 18 Jul 2023 10:27:03 +0000 (12:27 +0200)]
decompress_and_queue_packet: removed dead assignment

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
21 months ago.gitlab-ci.yml: update fedora build to 38
Nikos Mavrogiannopoulos [Tue, 18 Jul 2023 10:08:22 +0000 (12:08 +0200)]
.gitlab-ci.yml: update fedora build to 38

This will provide access to latest compiler and static analyzer.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
21 months agoFix broken link to Juniper PDF
Dimitri Papadopoulos [Mon, 17 Jul 2023 19:13:49 +0000 (21:13 +0200)]
Fix broken link to Juniper PDF

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
21 months agoMerge branch 'send_OS_info_to_Pulse_server' into 'master'
Daniel Lenski [Fri, 30 Jun 2023 21:23:29 +0000 (21:23 +0000)]
Merge branch 'send_OS_info_to_Pulse_server' into 'master'

OpenConnect should report the client operating system to Pulse servers

See merge request openconnect/openconnect!481

21 months agoMore comments on contents of hard-coded oNCP packets
Daniel Lenski [Fri, 30 Jun 2023 21:12:27 +0000 (14:12 -0700)]
More comments on contents of hard-coded oNCP packets

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoMerge branch 'handle_Pulse_main_config_packet_up_to_1_MiB' into 'master'
Daniel Lenski [Fri, 30 Jun 2023 21:14:58 +0000 (21:14 +0000)]
Merge branch 'handle_Pulse_main_config_packet_up_to_1_MiB' into 'master'

Handle Pulse main config packets up to 1 MiB

See merge request openconnect/openconnect!480

21 months agoUse suggested package summary everywhere
Dimitri Papadopoulos [Tue, 23 May 2023 10:18:58 +0000 (12:18 +0200)]
Use suggested package summary everywhere

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
21 months agoUpdate supported protocols
Dimitri Papadopoulos [Sat, 20 May 2023 12:10:39 +0000 (14:10 +0200)]
Update supported protocols

* Standardise on Array Networks, not Array Networks AG

  From https://arraynetworks.com/ssl-vpn/:

  > Array SSL VPN gateways provide secure remote access to
  > applications, desktops, file shares, networks, and Web
  > sites from a broad range of remote and mobile devices.
  > Deployed at the network perimeter or in front of
  > business-critical resources, the AG provides secure
  > remote access for employees, guests, partners, and
  > other communities of interest. SSL VPNs are ideal for
  > simplifying the user experience while reducing potential
  > attack vectors.
  >
  > Every AG SSL VPN provides a complete secure access
  > feature set, including TLS encrypted connectivity,
  > device validation, endpoint and server-side security,
  > advanced AAA, and granular policy controls. Available
  > as physical or virtual appliances, or on your choice
  > of public cloud, the AG Series is ideal for businesses
  > needing enterprise-wide remote access, and for cloud
  > service providers needing flexible remote access to
  > meet broad ranging customer requirements.

  I think AG refers to the gateway series that support SSL VPN,
  not to the protocol.
* PAN → Palo Alto Networks

  End-users may not know of this abbreviation, which is not
  used in the documentation and marketing material.
* Add Ivanti to Pulse Connect Secure
* List these protocols separately:
  - Juniper Network Connect
  - Pulse/Ivanti Connect Secure

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
21 months agoUpdate changelog
Daniel Lenski [Sat, 17 Jun 2023 20:07:19 +0000 (13:07 -0700)]
Update changelog

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoOpenConnect should report the client operating system to Pulse servers
Daniel Lenski [Tue, 13 Jun 2023 19:10:33 +0000 (12:10 -0700)]
OpenConnect should report the client operating system to Pulse servers

We already know from a MITM capture on Windows how and where this is
reported by the official clients.

As seen with other protocols, some Pulse VPN servers may rely on the
presence of OS information in order to respond with a complete and correct
main configuration packet (see possible cases of this requirement in
https://gitlab.com/openconnect/openconnect/-/issues/459).

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoUpdate changelog
Daniel Lenski [Mon, 29 May 2023 18:31:28 +0000 (11:31 -0700)]
Update changelog

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoHandle Pulse main config packets up to 1 MiB
Daniel Lenski [Fri, 26 May 2023 19:39:33 +0000 (12:39 -0700)]
Handle Pulse main config packets up to 1 MiB

Our implementation has assumed that the entirety of the main Pulse
configuration “packet” will fit in one TLS record; however,
https://gitlab.com/openconnect/openconnect/-/issues/617 demonstrates that it
can in fact exceed 16 KiB if it includes e.g.  a large proxy configuration.

In order to handle this, we need to dynamically allocate the space to hold
this packet, and read it in a loop.

(See https://gitlab.com/openconnect/openconnect/-/commit/2d77040a870851a625de16938fcdda6a5494d7ed
for a previous case where a configuration packet unexpectedly exceeded the
limits of a single TLS record.)

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoLog attributes for proxy auto-config (PAC) in Pulse configuration
Daniel Lenski [Fri, 2 Jun 2023 21:48:32 +0000 (14:48 -0700)]
Log attributes for proxy auto-config (PAC) in Pulse configuration

Per https://gitlab.com/openconnect/openconnect/-/issues/617#note_1413539553,
Pulse servers may send proxy auto-config information
(https://en.wikipedia.org/wiki/Proxy_auto-config) in two forms
in the main configuration packet:

- attr 0x4023 contains a URL where the PAC file can be downloaded
- attr 0x4009 contains the full contents of the PAC file (may
  be very large)

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
21 months agoCI: Allow Android jobs to fail (error → warning)
Daniel Lenski [Fri, 30 Jun 2023 20:50:33 +0000 (13:50 -0700)]
CI: Allow Android jobs to fail (error → warning)

Until we figure out how to make these reliable, they're preventing automatic
merging of several MRs.  Android is decidedly a third- or fourth-class
platform in terms of OpenConnect developers' ability and willingness to
support it.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
22 months agoStricter chunked-encoding error detection
Daniel Lenski [Thu, 20 Apr 2023 21:18:25 +0000 (14:18 -0700)]
Stricter chunked-encoding error detection

The only acceptable inputs for an HTTP chunk length/header line are
non-negative hexadecimal integers followed immediately by EOL, or followed
by `;`, then followed by chunk extensions which we ignore.

We should prevent anything other than these from being tacitly accepted as
equivalent to a length of 0, which indicates the last chunk.

Improvements in the error handling of chunked Transfer-Encoding responses
were discussed in https://gitlab.com/openconnect/openconnect/-/issues/597.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
22 months agoFix TPMv2 ECDSA signature ASN.1
David Woodhouse [Wed, 14 Jun 2023 08:20:53 +0000 (09:20 +0100)]
Fix TPMv2 ECDSA signature ASN.1

I lifted this code to use it elsewhere and found that 'openssl dgst -verify'
didn't like the resulting signatures.

So ensure we have a definite lengh for the overall SEQUENCE and that we
don't have gratuitous zeroes at the start of each INTEGER. Even 'openssl
asn1parse' whines about the latter, calling it a :BAD INTEGER:.

I can't find any documentation which mandates DER, and I don't see the
point since there's a randomly generated salt so there's no 'canonical'
signature result anyway. But it doesn't hurt, and this matches what
GnuTLS does in 3.6.0 onwards where it *does* provide this function.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
23 months agoMerge branch 'openssl-legacy' of gitlab.com:floppym/openconnect
David Woodhouse [Tue, 23 May 2023 17:15:53 +0000 (10:15 -0700)]
Merge branch 'openssl-legacy' of gitlab.com:floppym/openconnect

23 months agoci: do not XFAIL auth-certificate for Fedora/OpenSSL
Mike Gilbert [Tue, 23 May 2023 15:02:12 +0000 (11:02 -0400)]
ci: do not XFAIL auth-certificate for Fedora/OpenSSL

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
23 months agoopenssl: load the "legacy" provider when insecure-crypto is allowed
Mike Gilbert [Tue, 23 May 2023 14:35:45 +0000 (10:35 -0400)]
openssl: load the "legacy" provider when insecure-crypto is allowed

Also enable insecure-crypto for the auth-certificate test, which uses
old ciphers.

Fixes: https://gitlab.com/openconnect/openconnect/-/issues/615
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
23 months agobad_dtls_test: set security level to 0
Mike Gilbert [Mon, 22 May 2023 18:07:00 +0000 (14:07 -0400)]
bad_dtls_test: set security level to 0

Fixes a failure with OpenSSL 3.1.0.

40871165FC7E0000:error:0A0000BF:SSL routines:tls_setup_handshake:no protocols available:../openssl-3.1.0/ssl/statem/statem_lib.c:104:
Unexpected handshake result at initial call!
Cisco BadDTLS test: FAILED
FAIL bad_dtls_test (exit status: 1)

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
23 months agoDon't use bash for symbols test
David Woodhouse [Mon, 22 May 2023 17:26:37 +0000 (10:26 -0700)]
Don't use bash for symbols test

Might fix #614?
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
23 months agoUpdate translations from GNOME
David Woodhouse [Sun, 21 May 2023 12:48:52 +0000 (13:48 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
23 months agoMerge branch 'Test_suite' into 'master'
Dimitri Papadopoulos Orfanos [Sat, 20 May 2023 10:58:47 +0000 (10:58 +0000)]
Merge branch 'Test_suite' into 'master'

Remove duplicate paragraph from docs

See merge request openconnect/openconnect!463