1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-03-15 18:29:16 +01:00

Merge branch 'devel/avoid_logging_passwords'

This commit is contained in:
Fredrik Thulin 2011-03-03 15:07:53 +01:00
commit a5594fa09c

View File

@ -555,15 +555,15 @@ pam_sm_authenticate (pam_handle_t * pamh,
goto done; goto done;
} }
DBG (("conv returned: %s", resp->resp)); DBG (("conv returned %i bytes", strlen(resp->resp)));
password = resp->resp; password = resp->resp;
} }
password_len = strlen (password); password_len = strlen (password);
if (password_len < TOKEN_OTP_LEN) if (password_len < (cfg.token_id_length + TOKEN_OTP_LEN))
{ {
DBG (("OTP too short: %s", password)); DBG (("OTP too short: %i < %i", password_len, TOKEN_OTP_LEN));
retval = PAM_AUTH_ERR; retval = PAM_AUTH_ERR;
goto done; goto done;
} }
@ -589,7 +589,8 @@ pam_sm_authenticate (pam_handle_t * pamh,
onlypasswd[password_len - (TOKEN_OTP_LEN + cfg.token_id_length)] = '\0'; onlypasswd[password_len - (TOKEN_OTP_LEN + cfg.token_id_length)] = '\0';
DBG (("Password: %s ", onlypasswd)); DBG (("Extracted a probable system password entered before the OTP - "
"setting item PAM_AUTHTOK"));
retval = pam_set_item (pamh, PAM_AUTHTOK, onlypasswd); retval = pam_set_item (pamh, PAM_AUTHTOK, onlypasswd);
free (onlypasswd); free (onlypasswd);