~mamarley/openconnect/+git/gitlab-main:calculate_Pulse_MTU_independently_of_the_server

Last commit made on 2022-06-15
Get this branch:
git clone -b calculate_Pulse_MTU_independently_of_the_server https://git.launchpad.net/~mamarley/openconnect/+git/gitlab-main

Branch merges

Branch information

Name:
calculate_Pulse_MTU_independently_of_the_server
Repository:
lp:~mamarley/openconnect/+git/gitlab-main

Recent commits

72c95f7... by Dan Lenski

[QUICK-AND-DIRTY] Calculate Pulse MTU independently of the server and override if the server's value seems too high

See comments inline for what's going on here.

Signed-off-by: Daniel Lenski <email address hidden>

37b6a79... by Dan Lenski

Clarify purpose/scope of --usergroup option

The name '--usergroup' exists purely for historical/Cisco-specific reasons.
Its function is simply to override the *path* of the URL for the initial
HTTPS request to the server.

Thus 'openconnect --usergroup loginRealm vpn.server.com'
and 'openconnect https://vpn.server.com/loginRealm' are entirely equivalent;
with most front-ends, specifying the URL directly is the only way to set the
path.

Signed-off-by: Daniel Lenski <email address hidden>

8953715... by Dan Lenski

Clarify purpose/scope of --authgroup option

We frequently get questions from users who are unsure of how to
automatically enter an authentication dropdown selection using the command
line client. A recent example:
https://lists.infradead.org/pipermail/openconnect-devel/2022-May/005125.html

The `--authgroup=GROUP` option is specifically designed for this purpose: it can enter
a value into "the right" dropdown/list field on multiple protocols:

- Cisco AnyConnect/ocserv: "authgroup" selection form field
- Juniper: "realm" OR "frmSelectRoles" selection form field
- Pulse: "realm" selection form field
- Fortinet: "realm" selection form field
- F5: "domain" selection form field
- GlobalProtect: "gateway" selection form field (found on the "portal" interface;
  this one actually controls the choice of gateway server)

The functionality of the `--authgroup` option is not as obvious as
it could/should be because the name "authgroup" is Cisco-specific.

This patch improves the `--help` output and openconnect(8) man page to
show that it works with other protocols as well, and mention the names
of the relevant fields for those protocols.

Signed-off-by: Daniel Lenski <email address hidden>

6246bbd... by Dimitri Papadopoulos Orfanos <email address hidden>

Merge branch 'const' into 'master'

Fix constness again in HKDF/HPKE-related functions

See merge request openconnect/openconnect!384

422f5f8... by Dan Lenski

Explain why explicit proxying usually doesn't work in MITM docs

Simply put, many VPN clients *ignore* an explicitly-set browser/system
proxy, whether as an intentional anti-MITM measure or as a consequence of
inconsistent and incompetent design and coding.

This is why transparent proxying is generally necessary in order to reliably
MITM a proprietary VPN client.

Initially discussed in
https://gitlab.com/openconnect/openconnect/-/issues/366#note_968160422.

Signed-off-by: Daniel Lenski <email address hidden>

1172d80... by Dan Lenski

Factor out some of the most repetitive elements of gp-auth-and-config

Signed-off-by: Daniel Lenski <email address hidden>

64a0ba6... by Dan Lenski

Add a fake SAML handler/form to fake-gp-server.py

This allows authenticating to the fake server with https://github.com/dlenski/gp-saml-gui

    # Start fake server
    $ ./fake-gp-server localhost 8080 certs/server-{cert,key}.pem 2>&1 >/dev/null &

    # Configure fake server for SAML on the portal interface
    $ curl -sk https://localhost:8080/CONFIGURE -d portal_saml=portal-userauthcookie -d portal_cookie=portal-userauthcookie

    # Use gp-saml-gui to authenticate to it
    $ gp-saml-gui --no-verify localhost:8080
    ...
    ... pops up window
    ... fills out login form
    ...
    HOST=https://localhost:8080/global-protect/getconfig.esp:portal-userauthcookie
    USER=nobody
    COOKIE=FAKE_username_nobody_password_whatever
    OS=linux-64

The goal of this is to have a SAML-supporting GP server to test against
while modifying openconnect to directly call the GP SAML webview handler
itself (see https://github.com/dlenski/gp-saml-gui/issues/45).

Signed-off-by: Daniel Lenski <email address hidden>

c9b54db... by Dan Lenski

Rework GP fake server to have a persistent configuration

Until now, all of our Flask-based servers for testing protocol
authentication flows have "cheated" a bit.

They're configurable (e.g. should the authentication require a 2FA token,
or should it not?), but this configuration has not actually been persisted
by the server.

Instead, the server sends the client a session cookie which has the desired
*server* configuration glommed into it, and relies on the client sending
this cookie back on every request (which OpenConnect obliges, for
authentication requests) so that the server can "remember" what it's
configured to do.

This is very confusing to read and understand, and it's also untenable to
continue using it for fake servers that simulate external authentication
(SAML/SSO). That's because external authentication uses a separate
browser/handler for the authentication flow, so it won't share the session
cookies.

This modifies the fake GP server to store a persistent in-memory
configuration which can easily be set and inspected with cURL:

    $ ./fake-gp-server localhost 8080 certs/server-{cert,key}.pem 2>&1 >/dev/null &
    $ curl -sk https://localhost:8080/CONFIGURE -d gw_2fa=1
    $ curl -sk https://localhost:8080/CONFIGURE
    Current configuration of fake GP server configuration:
    TestConfiguration(gateways=('Default gateway',), portal_2fa=False, gw_2fa=True, portal_cookie=None, portal_saml=None, gateway_saml=None)
    $ openconnect --protocol=gp localhost:8080
    Please login to this fake GP VPN portal
    Username: fakeusername
    Password: *******
    ...
    2FA challenge from gateway
    Challenge:

Contrast this with the old approach:

    $ ./fake-gp-server localhost 8080 certs/server-{cert,kem}.pem 2>&1 >/dev/null &
    $ openconnect --protocol=gp localhost:8080/global-protect/testconfig.esp?gw_2fa=1

The gp-auth-and-config tests are modified accordingly to set the persistent
configuration of the fake server.

Signed-off-by: Daniel Lenski <email address hidden>

0a55585... by Dan Lenski

Cleanup GP auth tests (don't need to disable IPv6 here)

Signed-off-by: Daniel Lenski <email address hidden>

bfafc8f... by Dan Lenski

Clearer error for list-system-keys on Unix-like platforms

It appears that the `gnutls_system_key*` functions are only implemented on
Windows currently. Lots of people are likely to test this executable on
Unix-y systems, so we should give a clearer error message.

Signed-off-by: Daniel Lenski <email address hidden>