From 2ffd54a24caa1aa0adc2f02c4c874e0dad23e2fc Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 14 Jun 2012 09:25:38 +0200 Subject: [PATCH] use errstr to communicate with the user --- pam_yubico.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pam_yubico.c b/pam_yubico.c index 36ec4b4..55fd382 100644 --- a/pam_yubico.c +++ b/pam_yubico.c @@ -581,8 +581,9 @@ do_challenge_response(pam_handle_t *pamh, struct cfg *cfg, const char *username) /* There is a bug that makes the YubiKey 2.2 send the same response for all challenges unless HMAC_LT64 is set, check for that here */ - if (memcmp(buf, state.response response_len) == 0) { - D(("Same response for second challenge, YubiKey should be reconfigured with the option HMAC_LT64")); + if (memcmp(buf, state.response, response_len) == 0) { + errstr = "Same response for second challenge, YubiKey should be reconfigured with the option HMAC_LT64"; + goto out; } /* the yk_* functions leave 'junk' in errno */