Commit Graph

430 Commits

Author SHA1 Message Date
Nikos Mavrogiannopoulos
95fb96ee32 test-udp-listen-host: added some reliability improvements
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-06-29 12:06:29 +02:00
Nikos Mavrogiannopoulos
fdb80bb23e tests: detect openconnect's path and fail if not found
Resolves: #311

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-06-11 22:26:33 +02:00
Nikos Mavrogiannopoulos
1dacbb13a7 tests: added test cases for no-route in group and main configuration
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-30 10:38:44 +02:00
Alan Jowett
ce66485ee6 Uses fork/exec to limit memory footprint of ocserv-worker processes
Capture all the required worker process state in a protobuf and
pass to worker via env. Snapshot all config files to ensure ocserv-sm
and ocserv-worker remain in sync. Split ocserv-worker functionality
into it's own executable with minimal dependencies.

Resolves: #285

Signed-off-by: Alan Jowett alanjo@microsoft.com
2020-05-25 08:33:16 +02:00
Nikos Mavrogiannopoulos
3a8e280a92 translate labels to groups when provided by client
This addresses issues with anyconnect clients which send back the descriptive labels.

Resolves #267

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-21 22:24:17 +02:00
Nikos Mavrogiannopoulos
03b05526c3 tests: check whether ipv6 interface is up
Relates: #301

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-13 06:16:27 +02:00
Alan Jowett
9d9907ef5e Attempt to download updated JWKs if the client presents an unknown key.
Limit the download of keys to every 900s.

Resolves: #284
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-04-19 16:30:12 -06:00
Nikos Mavrogiannopoulos
fd2bd42cb2 .gitlab-ci.yml: corrected kerberos tests
This also corrects the kerberos test script environment
to enable running the test.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-04-10 23:06:07 +02:00
Nikos Mavrogiannopoulos
e9251a66e8 tests: test-max-same-1/test-multi-cookie: use update_config
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2020-04-08 19:37:57 +02:00
Nikos Mavrogiannopoulos
9246431590 tests: radius tests are not run when radius is disabled
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-04-08 19:25:56 +02:00
Nikos Mavrogiannopoulos
689843e874 tests: separate resources in haproxy-connect in test-udp-listen-host
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-04-08 19:25:47 +02:00
Nikos Mavrogiannopoulos
fe99e77ccb vpnc-script: added attempt-reconnect
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-04-06 13:49:01 +02:00
Nikos Mavrogiannopoulos
2d9bc11f59 occtl: list actual banned entries
This fixes the ban entries listing from printing all the items in
the database, to all the items that are actually banned from
connecting.

Resolves: #272

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2020-04-03 22:09:14 +02:00
Nikos Mavrogiannopoulos
3544e3ee2b tests: verify environment under Apple clients
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-03-16 22:21:37 +01:00
Nikos Mavrogiannopoulos
65a7fcab67 tests: remove option pointing to non-existant script
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-03-15 13:23:35 +01:00
Nikos Mavrogiannopoulos
881953c293 Merge branch 'tmp-test-psk-negotiate' into 'master'
Fix PSK-NEGOTIATE ciphers

Closes #262

See merge request openconnect/ocserv!147
2020-03-12 19:40:32 +00:00
Nikos Mavrogiannopoulos
bcc07c935e tests: improved ipv6-prefix
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-03-12 19:47:50 +01:00
Nikos Mavrogiannopoulos
bf8616cbca tests: generate_oidc_test_data: fixed used of strncat
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-03-12 19:47:50 +01:00
Nikos Mavrogiannopoulos
5e817d3d60 tests: added test to test match-tls-dtls-ciphers config option
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-03-12 17:01:01 +01:00
Nikos Mavrogiannopoulos
5097604d4d tests: added test for PSK-NEGOTIATE ciphers
Relates: #262

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-03-12 13:23:06 +01:00
Alan Jowett
780fbb89a0 Script needs access to additional client metadata.
Export more information to the script, including client device platform,
type and user agent.

Resolves: #256

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-03-11 09:13:55 +01:00
Alan Jowett
b43e782b12 Add support for RFC6750 bearer tokens to ocserv
This permits the validation of OpenID Connect auth tokens OpenID
Connect is an OAuth 2.0 protocol used to identify a resource owner
(VPN client end-user) to a resource server (VPN server) intermediated
by an Authorization server.

Resolves: #240

Signed-off-by: Alan TG Jowett <alan.jowett@microsoft.com>
2020-03-09 21:48:04 +01:00
Nikos Mavrogiannopoulos
cc651b9de5 Ensure scripts have all the information on all disconnection types
When a client re-uses a cookie and takes over a previous connection
previously the disconnect script of the old connection wouldn't receive
the IP information. Ensure that all information is provided to scripts
at this case.

Resolves: #231

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-23 13:44:19 +01:00
Nikos Mavrogiannopoulos
d852195e64 tests: reproduce #231
This modifies test-pass-script to force a DPD timeout to
verify whether ${IP_REMOTE} is set on the disconnect script.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-19 22:17:31 +01:00
Nikos Mavrogiannopoulos
d28846404d Merge branch 'tmp-centos8' into 'master'
.gitlab-ci.yml: added centos8 build

See merge request openconnect/ocserv!129
2020-02-13 22:15:17 +00:00
Nikos Mavrogiannopoulos
a8d34a80b9 tests: radius: save log on CI failure
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-13 22:25:13 +01:00
Nikos Mavrogiannopoulos
ebe7c3bfb4 tests: added test to check whether server blocks if script blocks
This test verifies that the server will continue to operate
even if the up script will block indefinitely.

Resolves: #241

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-07 22:46:21 +01:00
Nikos Mavrogiannopoulos
ea3f6900c1 common.sh: print message when script cannot run
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-02-07 17:12:59 +01:00
Nikos Mavrogiannopoulos
55d5af2ebc check_multiple_users: do not account disconnected ones
When max-same-clients is set to 1 and a user re-using a cookie
connects, check_multiple_users() would prevent the user from
reconnecting. This corrects the issue by taking into account
only valid sessions that have not yet been disconnected.

Resolves: #223

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-12-16 21:30:24 +01:00
Nikos Mavrogiannopoulos
cfa62cf6b4 Merge branch 'tmp-test-kerberos' into 'master'
tests: added kerberos test case

See merge request openconnect/ocserv!116
2019-12-12 15:29:35 +00:00
Nikos Mavrogiannopoulos
c9e907c841 tests: replaced docker-based kerberos test case with one that runs in CI
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 14:51:21 +01:00
Nikos Mavrogiannopoulos
ea845a57fc tests: clean-up pam server initiation
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 11:10:19 +01:00
Nikos Mavrogiannopoulos
4bcf29643d ocserv: added support for per-user split-dns directive
Resolves: #229

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 11:06:47 +01:00
Lele Long
17ed47488d Add udp-listen-host option for DTLS
This option supports different listen addresses for tcp and
udp such as haproxy for tcp, but support dtls at the same time (haproxy
does not support UDP at the moment)
2019-09-30 09:01:55 +08:00
Nikos Mavrogiannopoulos
92b5db7b26 occtl: fix json in show status
This removes a trailing comma from the end of the listing, and
adds a missing one.

Resolves: #220

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-09-25 20:37:16 +02:00
Alexey Dotsenko
0153172c03 tests: add radius otp test
tests (radius-otp): add a check radcli version (atleast 1.2.7), since debian uses version
1.2.6, which does not support Access-Challenge server response.

tests: show debug messages only in VERBOSE mode

tests (radius-otp): replace test for option max_challenge to macro MAX_CHALLENGE

Signed-off-by: Alexey Dotsenko <lex@rwx.su>
2019-06-24 17:25:44 +03:00
Nikos Mavrogiannopoulos
15380220ac tests: rewrite the radius tests using namespaces
This simplifies the test and makes it runnable in our CI.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-06-03 22:47:23 +02:00
Nikos Mavrogiannopoulos
6cac225203 tests: make ping cmd functional in centos7,6
It requires the '-6' option to be able to function with
IPv6 addresses.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-03-12 17:21:17 +01:00
Nikos Mavrogiannopoulos
27c83dcf42 tests: consistently disable isolate-workers in tests
That is to prevent coverage reporting in tests.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-20 06:43:47 +01:00
Nikos Mavrogiannopoulos
8ba3987f4c occtl: print the TLS session information, even if no DTLS channel
This ensures that the main process receives the TLS channel information
early and does not depend on DTLS channel establishment. Furthermore,
we refactor to make setup_dtls_psk_keys() fail early when no TLS channel
is available.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-19 20:09:53 +01:00
Nikos Mavrogiannopoulos
e0f847b984 worker: added safety check for selected DTLS ciphersuite prior to use
This avoids a crash when no DTLS ciphersuite is selected and adds a
test case for negotiation without DTLS.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-19 18:19:11 +01:00
Nikos Mavrogiannopoulos
7fc4e0d0ee tests: added tests for anyconnect's DTLS1.2 support
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-19 18:19:09 +01:00
Nikos Mavrogiannopoulos
c640ffd955 test-cookie-timeout: updated for new openconnect kill semantics
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-19 13:39:11 +01:00
Nikos Mavrogiannopoulos
2dfa37784d tests: moved server-cert-rsa-pss to dist_check_scripts
The gnutls included in distributions is expected to work well
with RSA-PSS.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-06 20:07:53 +01:00
Nikos Mavrogiannopoulos
b181f20a2e tests: added functionality test for config-per-group
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-11-18 21:06:22 +01:00
Nikos Mavrogiannopoulos
4e51e2a0ac tests: added check with empty password
Relates #171

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-09-22 21:11:19 +02:00
Nikos Mavrogiannopoulos
3a330b8d85 tests: added unit tests for AES-128-GCM and AES-256-GCM
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-07-20 22:06:11 +02:00
Nikos Mavrogiannopoulos
579cfc0ead Added support for AES-256-CBC
This enables support for AES-256 for anyconnect clients which
do not support AES-GCM. Also prioritized the 256-bit ciphers
higher than the 128-bit ones.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-07-20 21:58:49 +02:00
Nikos Mavrogiannopoulos
9ca7da7689 added missing file
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-05-12 08:20:59 +02:00
Nikos Mavrogiannopoulos
807ce345de main: create a sec-mod socket file independent of pid
That addresses the issue of not being able to run under systemd,
or under non-forking mode. Added test case to detect proper
operation.

Resolves #154

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-05-11 22:04:28 +02:00