mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-27 06:54:16 +01:00
Corrected a few log entries
This commit is contained in:
parent
0e41f1cb53
commit
bfee638917
@ -95,10 +95,12 @@ if ($localParams['active'] != 1) {
|
||||
/* Conditional update local database */
|
||||
$sync->updateDbCounters($syncParams);
|
||||
|
||||
$myLog->log(LOG_DEBUG, 'Local params ' , $localParams);
|
||||
$myLog->log(LOG_DEBUG, 'Sync request params ' , $syncParams);
|
||||
|
||||
if ($sync->countersHigherThan($localParams, $syncParams)) {
|
||||
/* sync counters are lower than local counters */
|
||||
$myLog->log(LOG_WARNING, 'Remote server out of sync. Local params ' , $localParams);
|
||||
$myLog->log(LOG_WARNING, 'Remote server out of sync. Sync params ' , $syncParams);
|
||||
$myLog->log(LOG_WARNING, 'Remote server out of sync.');
|
||||
}
|
||||
|
||||
if ($sync->countersEqual($localParams, $syncParams)) {
|
||||
@ -106,16 +108,14 @@ if ($sync->countersEqual($localParams, $syncParams)) {
|
||||
if ($syncParams['modified']==$localParams['modified']) {
|
||||
/* sync modified is equal to local modified.
|
||||
Sync request is unnessecarily sent, we log a "light" warning */
|
||||
$myLog->log(LOG_WARNING, 'Sync request unnessecarily sent');
|
||||
$myLog->log(LOG_NOTICE, 'Sync request unnessecarily sent');
|
||||
} else {
|
||||
/* sync modified is not equal to local modified.
|
||||
We have an OTP replay attempt somewhere in the system */
|
||||
$myLog->log(LOG_WARNING, 'Replayed OTP attempt. Modified differs. Local ', $localParams);
|
||||
$myLog->log(LOG_WARNING, 'Replayed OTP attempt. Modified differs. Sync ', $syncParams);
|
||||
$myLog->log(LOG_WARNING, 'We might have a replay. 2 events at different times have generated the same counters');
|
||||
}
|
||||
if ($syncParams['nonce']!=$localParams['nonce']) {
|
||||
$myLog->log(LOG_WARNING, 'Replayed OTP attempt. Nonce differs. Local ', $localParams);
|
||||
$myLog->log(LOG_WARNING, 'Replayed OTP attempt. Nonce differs. Sync ', $syncParams);
|
||||
$myLog->log(LOG_WARNING, 'Remote server has received a request to validate an already validated OTP');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ class SyncLib
|
||||
|
||||
if (preg_match("/status=OK/", $response)) {
|
||||
$resParams=$this->parseParamsFromMultiLineString($response);
|
||||
$this->log(LOG_NOTICE, "response contains ", $resParams);
|
||||
$this->log(LOG_DEBUG, "response contains ", $resParams);
|
||||
|
||||
/* Update database counters */
|
||||
$this->updateDbCounters($resParams);
|
||||
@ -315,8 +315,7 @@ class SyncLib
|
||||
(indicating REPLAYED_OTP)
|
||||
*/
|
||||
|
||||
$this->log(LOG_WARNING, "queued:replayed OTP, remote counters " , $resParams);
|
||||
$this->log(LOG_WARNING, "queued:replayed OTP, otp counters", $otpParams);
|
||||
$this->log(LOG_WARNING, "queued:Remote server has higher or equal counters than OTP. This response would have marked the OTP as invalid. ");
|
||||
}
|
||||
|
||||
/* Deletion */
|
||||
@ -369,8 +368,9 @@ class SyncLib
|
||||
foreach ($ans_arr as $answer){
|
||||
/* Parse out parameters from each response */
|
||||
$resParams=$this->parseParamsFromMultiLineString($answer);
|
||||
$this->log(LOG_NOTICE, "local db contains ", $localParams);
|
||||
$this->log(LOG_NOTICE, "response contains ", $resParams);
|
||||
$this->log(LOG_DEBUG, "local db contains ", $localParams);
|
||||
$this->log(LOG_DEBUG, "response contains ", $resParams);
|
||||
$this->log(LOG_DEBUG, "OTP contains " , $this->otpParams);
|
||||
|
||||
/* Update internal DB (conditional) */
|
||||
|
||||
@ -383,16 +383,14 @@ class SyncLib
|
||||
(indicating that remote server wasn't synced)
|
||||
*/
|
||||
if ($this->countersHigherThan($localParams, $resParams)) {
|
||||
$this->log(LOG_WARNING, "Remote server out of sync, local counters ", $localParams);
|
||||
$this->log(LOG_WARNING, "Remote server out of sync, remote counters ", $resParams);
|
||||
$this->log(LOG_WARNING, "Remote server out of sync");
|
||||
}
|
||||
|
||||
/* If received sync response have higher counters than local db
|
||||
(indicating that local server wasn't synced)
|
||||
*/
|
||||
if ($this->countersHigherThan($resParams, $localParams)) {
|
||||
$this->log(LOG_WARNING, "Local server out of sync, local counters ", $localParams);
|
||||
$this->log(LOG_WARNING, "Local server out of sync, remote counters ", $resParams);
|
||||
$this->log(LOG_WARNING, "Local server out of sync");
|
||||
}
|
||||
|
||||
if ($this->countersHigherThan($resParams, $this->otpParams) ||
|
||||
@ -403,8 +401,7 @@ class SyncLib
|
||||
(indicating REPLAYED_OTP)
|
||||
*/
|
||||
|
||||
$this->log(LOG_WARNING, "replayed OTP, remote counters " , $resParams);
|
||||
$this->log(LOG_WARNING, "replayed OTP, otp counters", $this->otpParams);
|
||||
$this->log(LOG_WARNING, "Replayed OTP");
|
||||
} else {
|
||||
|
||||
/* The answer is ok since a REPLAY was not indicated */
|
||||
|
Loading…
x
Reference in New Issue
Block a user