From 8c5352f0175bf063056b54118cb93edb734d15a0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 3 May 2016 23:16:17 +0200 Subject: fix error condition for yk_challenge_response() --- udev/ykfde.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'udev') diff --git a/udev/ykfde.c b/udev/ykfde.c index 5d72d81..43b25e4 100644 --- a/udev/ykfde.c +++ b/udev/ykfde.c @@ -114,10 +114,11 @@ static int try_answer(YK_KEY * yk, uint8_t slot, const char * ask_file, char * c } /* do challenge/response and encode to hex */ - if ((rc = yk_challenge_response(yk, slot, true, - CHALLENGELEN, (unsigned char *) challenge, - RESPONSELEN, (unsigned char *) response)) < 0) { + if (yk_challenge_response(yk, slot, true, + CHALLENGELEN, (unsigned char *) challenge, + RESPONSELEN, (unsigned char *) response) == 0) { perror("yk_challenge_response() failed"); + rc = EXIT_FAILURE; goto out1; } yubikey_hex_encode((char *) passphrase, (char *) response, SHA1_DIGEST_SIZE); -- cgit v1.2.3-70-g09d2