From 22841cce430ba6a3ff3f780b21f32d4f9d981847 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Tue, 29 May 2012 15:36:02 +0200 Subject: [PATCH 1/3] Slightly less verbose log for remote IP check. --- ykval-sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ykval-sync.php b/ykval-sync.php index 54c86a9..e1620d6 100644 --- a/ykval-sync.php +++ b/ykval-sync.php @@ -26,8 +26,8 @@ if (! $sync->isConnected()) { $myLog->log(LOG_INFO, 'remote request ip is ' . $_SERVER['REMOTE_ADDR']); $allowed=False; +$myLog->log(LOG_DEBUG, 'checking for remote ip in allowed sync pool : ' . implode(", ", $baseParams['__YKVAL_ALLOWED_SYNC_POOL__'])); foreach ($baseParams['__YKVAL_ALLOWED_SYNC_POOL__'] as $server) { - $myLog->log(LOG_DEBUG, 'checking against ip ' . $server); if ($_SERVER['REMOTE_ADDR'] == $server) { $myLog->log(LOG_DEBUG, 'server ' . $server . ' is allowed'); $allowed=True; From 57866dc8293a64e66bbfbf2e180e8d0a854addf9 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Tue, 12 Jun 2012 14:21:56 +0200 Subject: [PATCH 2/3] More explanatory logging. --- ykval-sync.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ykval-sync.php b/ykval-sync.php index e1620d6..68bfa92 100644 --- a/ykval-sync.php +++ b/ykval-sync.php @@ -106,13 +106,13 @@ foreach (array('yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param) { $yk_publicname = $syncParams['yk_publicname']; $localParams = $sync->getLocalParams($yk_publicname); if (!$localParams) { - $myLog->log(LOG_NOTICE, 'Refusing sync of invalid Yubikey ' . $yk_publicname); + $myLog->log(LOG_NOTICE, 'Invalid Yubikey ' . $yk_publicname); sendResp(S_BACKEND_ERROR, $apiKey); exit; } if ($localParams['active'] != 1) { - $myLog->log(LOG_NOTICE, 'Refusing sync of de-activated Yubikey ' . $yk_publicname); + $myLog->log(LOG_NOTICE, 'De-activated Yubikey ' . $yk_publicname); sendResp(S_BAD_OTP, $apiKey); exit; } @@ -141,7 +141,7 @@ if ($sync->countersEqual($localParams, $syncParams)) { if ($syncParams['modified']==$localParams['modified'] && $syncParams['nonce']==$localParams['nonce']) { - $myLog->log(LOG_NOTICE, 'Sync request unnessecarily sent'); + $myLog->log(LOG_NOTICE, 'Sync request unnecessarily sent'); } if ($syncParams['modified']!=$localParams['modified'] && From af292fbcd60e514c22192acdf4753d5bcd443e3b Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Tue, 12 Jun 2012 14:50:31 +0200 Subject: [PATCH 3/3] Spelling, and more informational logging. --- ykval-sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ykval-sync.php b/ykval-sync.php index 68bfa92..7f81983 100644 --- a/ykval-sync.php +++ b/ykval-sync.php @@ -61,7 +61,7 @@ $tmp_log = "Received "; foreach ($syncParams as $param=>$value) { $value = getHttpVal($param, Null); if ($value==Null) { - $myLog->log(LOG_NOTICE, "Recevied request with parameter[s] missing"); + $myLog->log(LOG_NOTICE, "Received request with parameter[s] (" . $param . ") missing value"); sendResp(S_MISSING_PARAMETER, ''); exit; }