1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-01 01:52:18 +01:00

Reorder db query after yk-ksm query.

This commit is contained in:
Simon Josefsson 2009-03-11 11:02:55 +00:00
parent 98647728ca
commit b568a72892

View File

@ -64,19 +64,6 @@ if ($cd['chk_sig'] && $h == '') {
}
}
//// Get Yubikey from DB
//
$devId = substr($otp, 0, DEVICE_ID_LEN);
$ad = getAuthData($conn, $devId);
if ($ad == null) {
debug('Invalid Yubikey ' . $devId);
sendResp(S_BAD_OTP);
exit;
} else {
debug($ad);
}
//// Decode OTP from input
//
$otpinfo = decryptOTP($otp, $baseParams['__YKKMS_URL__']);
@ -86,6 +73,17 @@ if (!is_array($otpinfo)) {
}
debug($otpinfo);
//// Get Yubikey from DB
//
$devId = substr($otp, 0, DEVICE_ID_LEN);
$ad = getAuthData($conn, $devId);
if (!is_array($ad)) {
debug('Invalid Yubikey ' . $devId);
sendResp(S_BAD_OTP);
exit;
}
debug($ad);
//// Check the session counter
//
$sessionCounter = $otpinfo["session_counter"]; // From the req