From ad4d11f0157dde4340129b1bbfe9d9dd2e387acb Mon Sep 17 00:00:00 2001 From: Quentin Lux Date: Thu, 13 Aug 2020 08:44:27 -0400 Subject: [PATCH] Add password/keyboard_interactive test --- privacyidea_pam.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/privacyidea_pam.py b/privacyidea_pam.py index f132796..b0065b7 100644 --- a/privacyidea_pam.py +++ b/privacyidea_pam.py @@ -317,6 +317,14 @@ def pam_sm_authenticate(pamh, flags, argv): syslog.openlog(facility=syslog.LOG_AUTH) Auth = Authenticator(pamh, config) + + # Empty conversation to test password/keyboard_interactive + message = pamh.Message(pamh.PAM_TEXT_INFO, " ") + response = pamh.conversation(message) + if response.resp == '': + rval = pamh.PAM_AUTHINFO_UNAVAIL + return rval + try: if pamh.authtok is None or not try_first_pass: message = pamh.Message(pamh.PAM_PROMPT_ECHO_OFF, "%s " % prompt) @@ -486,4 +494,3 @@ def _create_table(c): c.execute("CREATE TABLE refilltokens (serial text, refilltoken text)") except sqlite3.OperationalError: pass -