mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01:52:18 +01:00
Refactor.
- getLocalParams() returns array or bool false on failure.
This commit is contained in:
parent
e604477fff
commit
ed169f49c5
@ -84,8 +84,7 @@ if (! $sync->isConnected()) {
|
||||
}
|
||||
|
||||
foreach($yubikeys as $key) {
|
||||
$localParams = $sync->getLocalParams($key);
|
||||
if (!$localParams) {
|
||||
if (($localParams = $sync->getLocalParams($key)) === FALSE) {
|
||||
logdie($myLog, 'ERROR Invalid Yubikey ' . $key);
|
||||
}
|
||||
|
||||
|
@ -116,8 +116,7 @@ foreach (array('modified','yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param
|
||||
|
||||
// get local counter data
|
||||
$yk_publicname = $syncParams['yk_publicname'];
|
||||
$localParams = $sync->getLocalParams($yk_publicname);
|
||||
if (!$localParams)
|
||||
if (($localParams = $sync->getLocalParams($yk_publicname)) === FALSE)
|
||||
{
|
||||
$myLog->log(LOG_NOTICE, 'Invalid Yubikey ' . $yk_publicname);
|
||||
sendResp(S_BACKEND_ERROR, $myLog);
|
||||
|
@ -282,8 +282,7 @@ $myLog->log(LOG_DEBUG, "Decrypted OTP:", $otpinfo);
|
||||
|
||||
// get Yubikey from DB
|
||||
$yk_publicname = substr($otp, 0, strlen ($otp) - TOKEN_LEN);
|
||||
$localParams = $sync->getLocalParams($yk_publicname);
|
||||
if (!$localParams)
|
||||
if (($localParams = $sync->getLocalParams($yk_publicname)) === FALSE)
|
||||
{
|
||||
$myLog->log(LOG_NOTICE, "Invalid Yubikey $yk_publicname");
|
||||
sendResp(S_BACKEND_ERROR, $myLog, $apiKey);
|
||||
|
Loading…
x
Reference in New Issue
Block a user