mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-09 18:01:49 +08:00
tests: check that empty password with correct OTP fails when password is set
Regression test: a user with both a password and OTP configured must not be able to authenticate by supplying an empty password (even with the correct OTP). Relates: #323 Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -59,6 +59,11 @@ echo -n "Connecting with correct password and OTP... "
|
||||
fail $PID "Could not connect with OTP!"
|
||||
echo ok
|
||||
|
||||
echo -n "Connecting with empty password and correct OTP (user has password set)... "
|
||||
( echo -e "\n328482\n" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= --cookieonly >/dev/null 2>&1 ) &&
|
||||
fail $PID "Connected with empty password when a password is set!"
|
||||
echo ok
|
||||
|
||||
echo -n "Connecting with empty password and wrong OTP... "
|
||||
( echo -e "999999\n" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u testuser --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= --cookieonly >/dev/null 2>&1 ) &&
|
||||
fail $PID "Should have not connected with wrong OTP!"
|
||||
|
||||
Reference in New Issue
Block a user