1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-03-04 12:29:19 +01:00

Cosmetic changes.

This commit is contained in:
Jean Paul Galea 2015-07-17 22:38:43 +02:00
parent c5b6b3c567
commit 13530c532f

View File

@ -466,7 +466,9 @@ class SyncLib
$this->answers = count($ans_arr); $this->answers = count($ans_arr);
$this->valid_answers = 0; $this->valid_answers = 0;
foreach ($ans_arr as $answer){
foreach ($ans_arr as $answer)
{
/* Parse out parameters from each response */ /* Parse out parameters from each response */
$resParams=$this->parseParamsFromMultiLineString($answer); $resParams=$this->parseParamsFromMultiLineString($answer);
$this->log(LOG_DEBUG, "local db contains ", $localParams); $this->log(LOG_DEBUG, "local db contains ", $localParams);
@ -484,32 +486,36 @@ class SyncLib
same in this situation and we have them at hand. same in this situation and we have them at hand.
*/ */
if ($this->countersHigherThan($localParams, $resParams)) { if ($this->countersHigherThan($localParams, $resParams))
{
$this->log(LOG_NOTICE, "Remote server out of sync"); $this->log(LOG_NOTICE, "Remote server out of sync");
} }
if ($this->countersHigherThan($resParams, $localParams)) { if ($this->countersHigherThan($resParams, $localParams))
{
$this->log(LOG_NOTICE, "Local server out of sync"); $this->log(LOG_NOTICE, "Local server out of sync");
} }
if ($this->countersEqual($resParams, $localParams) && if ($this->countersEqual($resParams, $localParams) && $resParams['nonce']!=$localParams['nonce'])
$resParams['nonce']!=$localParams['nonce']) { {
$this->log(LOG_NOTICE, "Servers out of sync. Nonce differs. "); $this->log(LOG_NOTICE, "Servers out of sync. Nonce differs. ");
} }
if ($this->countersEqual($resParams, $localParams) && $resParams['modified']!=$localParams['modified'])
if ($this->countersEqual($resParams, $localParams) && {
$resParams['modified']!=$localParams['modified']) {
$this->log(LOG_NOTICE, "Servers out of sync. Modified differs. "); $this->log(LOG_NOTICE, "Servers out of sync. Modified differs. ");
} }
if ($this->countersHigherThan($resParams, $this->otpParams)){ if ($this->countersHigherThan($resParams, $this->otpParams))
{
$this->log(LOG_WARNING, 'OTP is replayed. Sync response counters higher than OTP counters.'); $this->log(LOG_WARNING, 'OTP is replayed. Sync response counters higher than OTP counters.');
} }
elseif ($this->countersEqual($resParams, $this->otpParams) && elseif ($this->countersEqual($resParams, $this->otpParams) && $resParams['nonce']!=$this->otpParams['nonce'])
$resParams['nonce']!=$this->otpParams['nonce']) { {
$this->log(LOG_WARNING, 'OTP is replayed. Sync response counters equal to OTP counters and nonce differs.'); $this->log(LOG_WARNING, 'OTP is replayed. Sync response counters equal to OTP counters and nonce differs.');
} else { }
else
{
/* The answer is ok since a REPLAY was not indicated */ /* The answer is ok since a REPLAY was not indicated */
$this->valid_answers++; $this->valid_answers++;
} }