mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-03-01 21:29:18 +01:00
Cosmetic changes.
- more consistency with comment style.
This commit is contained in:
parent
365636e34a
commit
552c3f8939
@ -61,9 +61,7 @@ if (! $sync->isConnected()) {
|
|||||||
sendResp(S_BACKEND_ERROR, $myLog);
|
sendResp(S_BACKEND_ERROR, $myLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
// define requirements on protocol
|
||||||
# Define requirements on protocol
|
|
||||||
#
|
|
||||||
$syncParams = array(
|
$syncParams = array(
|
||||||
'modified' => NULL,
|
'modified' => NULL,
|
||||||
'otp' => NULL,
|
'otp' => NULL,
|
||||||
@ -75,9 +73,7 @@ $syncParams = array(
|
|||||||
'yk_low' => NULL
|
'yk_low' => NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
#
|
// extract values from HTTP request
|
||||||
# Extract values from HTTP request
|
|
||||||
#
|
|
||||||
$tmp_log = "Received ";
|
$tmp_log = "Received ";
|
||||||
foreach ($syncParams as $param=>$value) {
|
foreach ($syncParams as $param=>$value) {
|
||||||
$value = getHttpVal($param, NULL);
|
$value = getHttpVal($param, NULL);
|
||||||
@ -90,15 +86,13 @@ foreach ($syncParams as $param=>$value) {
|
|||||||
}
|
}
|
||||||
$myLog->log(LOG_INFO, $tmp_log);
|
$myLog->log(LOG_INFO, $tmp_log);
|
||||||
|
|
||||||
#
|
|
||||||
# At this point we should have the otp so let's add it to the logging module
|
// at this point we should have the otp so let's add it to the logging module
|
||||||
#
|
|
||||||
$myLog->addField('otp', $syncParams['otp']);
|
$myLog->addField('otp', $syncParams['otp']);
|
||||||
$sync->addField('otp', $syncParams['otp']);
|
$sync->addField('otp', $syncParams['otp']);
|
||||||
|
|
||||||
#
|
|
||||||
# Verify correctness of input parameters
|
// verify correctness of input parameters
|
||||||
#
|
|
||||||
foreach (array('modified','yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param)
|
foreach (array('modified','yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param)
|
||||||
{
|
{
|
||||||
// -1 is valid except for modified
|
// -1 is valid except for modified
|
||||||
@ -113,9 +107,7 @@ foreach (array('modified','yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param
|
|||||||
sendResp(S_MISSING_PARAMETER, $myLog);
|
sendResp(S_MISSING_PARAMETER, $myLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
// get local counter data
|
||||||
# Get local counter data
|
|
||||||
#
|
|
||||||
$yk_publicname = $syncParams['yk_publicname'];
|
$yk_publicname = $syncParams['yk_publicname'];
|
||||||
$localParams = $sync->getLocalParams($yk_publicname);
|
$localParams = $sync->getLocalParams($yk_publicname);
|
||||||
if (!$localParams) {
|
if (!$localParams) {
|
||||||
@ -123,7 +115,7 @@ if (!$localParams) {
|
|||||||
sendResp(S_BACKEND_ERROR, $myLog);
|
sendResp(S_BACKEND_ERROR, $myLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Conditional update local database */
|
// conditional update local database
|
||||||
$sync->updateDbCounters($syncParams);
|
$sync->updateDbCounters($syncParams);
|
||||||
|
|
||||||
$myLog->log(LOG_DEBUG, 'Local params ', $localParams);
|
$myLog->log(LOG_DEBUG, 'Local params ', $localParams);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user