1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-03-04 03:29:18 +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->valid_answers = 0;
foreach ($ans_arr as $answer){
foreach ($ans_arr as $answer)
{
/* Parse out parameters from each response */
$resParams=$this->parseParamsFromMultiLineString($answer);
$this->log(LOG_DEBUG, "local db contains ", $localParams);
@ -484,32 +486,36 @@ class SyncLib
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");
}
if ($this->countersHigherThan($resParams, $localParams)) {
if ($this->countersHigherThan($resParams, $localParams))
{
$this->log(LOG_NOTICE, "Local server out of sync");
}
if ($this->countersEqual($resParams, $localParams) &&
$resParams['nonce']!=$localParams['nonce']) {
if ($this->countersEqual($resParams, $localParams) && $resParams['nonce']!=$localParams['nonce'])
{
$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. ");
}
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.');
}
elseif ($this->countersEqual($resParams, $this->otpParams) &&
$resParams['nonce']!=$this->otpParams['nonce']) {
elseif ($this->countersEqual($resParams, $this->otpParams) && $resParams['nonce']!=$this->otpParams['nonce'])
{
$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 */
$this->valid_answers++;
}