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:
Nikos Mavrogiannopoulos
2026-04-03 13:58:18 +02:00
parent ebb34f6787
commit 85b4d19f0a
+5
View File
@@ -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!"