CentOS 5.9 And Google-authenticator

Home » CentOS » CentOS 5.9 And Google-authenticator
CentOS No Comments

I’m playing with google-authenticator libpam


It appears to be failing the “make test” on CentOS 5.9 32bit.

Testing base32 encoding
Testing base32 decoding
Testing HMAC_SHA1
Loading PAM module

Running tests, querying for verification code
Testing failed login attempt
Testing required number of digits
Testing a blank response
Test handling of missing state files
Testing successful login
Testing WINDOW_SIZE option
Testing DISALLOW_REUSE option
Testing RATE_LIMIT option
pam_google_authenticator_unittest: pam_google_authenticator_unittest.c:137: verify_prompts_shown: Assertion `num_prompts_shown == expected_prompts_shown’ failed.
Invalid verification code
make: *** [test] Error 1

Playing with the code…

// Test TIME_SKEW option
puts(“Testing TIME_SKEW”);
for (int i = 0; i < 4; ++i) { set_time((12000 + i)*30); char buf[7]; response = buf; sprintf(response, "%06d", compute_code(binary_secret, binary_secret_len, 11000 + i)); assert(pam_sm_open_session(NULL, 0, targc, targv) = (i >= 2 ? PAM_SUCCESS : PAM_SESSION_ERR));

Up to here works fine…

set_time(12010 * 30);
char buf[7];
response = buf;
sprintf(response, “%06d”, compute_code(binary_secret,
binary_secret_len, 11010));
assert(pam_sm_open_session(NULL, 0, 1,
(const char *[]){ “noskewadj”, 0 }) = PAM_SESSION_ERR);

This is where it fails.

The same code works correctly without error on CentOS 6.4 64bit.

Has anyone else managed to pass the tests on 5.9 32bit?