mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
Force full connection after cookie when a script is involved.
That is because in the new design of ocserv, the cookie is being provided prior to any script being run or evaluated.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
EXTRA_DIST = ca-key.pem ca.pem common.sh server-cert.pem server-key.pem test1.config \
|
EXTRA_DIST = ca-key.pem ca.pem common.sh server-cert.pem server-key.pem test1.config \
|
||||||
test1.passwd test-user-cert.config user-cert.pem user-key.pem test3.config test-iroute.config \
|
test1.passwd test-user-cert.config user-cert.pem user-key.pem test3.config test-iroute.config \
|
||||||
user-config/test test-pass-script.config test-multi-cookie.config test-pam.config \
|
user-config/test test-pass-script.config test-multi-cookie.config test-pam.config \
|
||||||
test-stress.config user-cert-wrong.pem connect-script
|
test-stress.config user-cert-wrong.pem connect-script kill-parent.sh
|
||||||
|
|
||||||
dist_check_SCRIPTS = test-pass test-pass-cert test-cert test-iroute test-pass-script \
|
dist_check_SCRIPTS = test-pass test-pass-cert test-cert test-iroute test-pass-script \
|
||||||
test-multi-cookie test-pam test-stress full-test
|
test-multi-cookie test-pam test-stress full-test
|
||||||
|
|||||||
5
tests/kill-parent.sh
Executable file
5
tests/kill-parent.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
kill $PPID
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -37,6 +37,11 @@ echo -n "Connecting to obtain cookie (with certificate)... "
|
|||||||
|
|
||||||
echo ok
|
echo ok
|
||||||
|
|
||||||
|
echo -n "Re-connecting to force script run... "
|
||||||
|
openconnect -q localhost:$PORT --sslkey ${srcdir}/user-key.pem -c ${srcdir}/user-cert.pem --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./kill-parent.sh </dev/null >/dev/null 2>&1
|
||||||
|
|
||||||
|
echo ok
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
echo -n "Checking if routes have been applied... "
|
echo -n "Checking if routes have been applied... "
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ echo "Connecting to obtain cookie... "
|
|||||||
( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u special --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
|
( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u special --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
|
||||||
fail $PID "Could not receive cookie from server"
|
fail $PID "Could not receive cookie from server"
|
||||||
|
|
||||||
|
echo "Re-connecting to force script run... "
|
||||||
|
echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u special --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 -s ./kill-parent.sh >/dev/null 2>&1
|
||||||
|
|
||||||
kill $PID
|
kill $PID
|
||||||
wait
|
wait
|
||||||
|
|||||||
Reference in New Issue
Block a user