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:
Nikos Mavrogiannopoulos
2014-05-15 11:52:17 +02:00
parent 68c4b2371b
commit 044b910128
4 changed files with 13 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
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 \
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 \
test-multi-cookie test-pam test-stress full-test

5
tests/kill-parent.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
kill $PPID
exit 0

View File

@@ -37,6 +37,11 @@ echo -n "Connecting to obtain cookie (with certificate)... "
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
echo -n "Checking if routes have been applied... "

View File

@@ -45,6 +45,8 @@ echo "Connecting to obtain cookie... "
( echo "!@#$%^&*()<>" | openconnect -q localhost:$PORT -u special --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
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
wait