mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-03-03 00:29:22 +01:00
Add sl and timeout to request log variables.
This commit is contained in:
parent
3edc7f077b
commit
0838ecf56f
@ -152,8 +152,10 @@ function otp2ksmurls ($otp, $client)
|
||||
* %use%
|
||||
* %tls%
|
||||
* %protocol%
|
||||
* %sl%
|
||||
* %timeout%
|
||||
*
|
||||
* If a value is malformed or not available,
|
||||
* a dash '-' is written instead.
|
||||
*/
|
||||
//$baseParams['__YKVAL_VERIFY_LOGFORMAT__'] = '[%time_start%] [%ip%] [%tls%] [%protocol%] [%client%] [%public_id%] [%otp%] [%status%] [%time_taken%] [%nonce%] [%signed%] [%counter%] [%low%] [%high%] [%use%]';
|
||||
//$baseParams['__YKVAL_VERIFY_LOGFORMAT__'] = '[%time_start%] [%time_taken%] [%ip%] [%tls%] [%protocol%] [%status%] [%client%] [%public_id%] [%otp%] [%sl%] [%timeout%] [%nonce%] [%signed%] [%counter%] [%low%] [%high%] [%use%]';
|
||||
|
@ -48,6 +48,8 @@ class LogVerify
|
||||
'use' => NULL,
|
||||
'tls' => NULL,
|
||||
'protocol' => NULL,
|
||||
'sl' => NULL,
|
||||
'timeout' => NULL,
|
||||
);
|
||||
|
||||
/**
|
||||
@ -169,6 +171,16 @@ class LogVerify
|
||||
else
|
||||
$a['protocol'] = '-';
|
||||
|
||||
if ( $a['sl'] !== 'fast'
|
||||
&& $a['sl'] !== 'secure'
|
||||
&& (preg_match('/^[0-9]{1,3}$/', $a['sl']) !== 1 || (((int) $a['sl']) > 100)))
|
||||
{
|
||||
$a['sl'] = '-';
|
||||
}
|
||||
|
||||
if (preg_match('/^[0-9]+$/', $a['timeout']) !== 1)
|
||||
$a['timeout'] = '-';
|
||||
|
||||
$start = explode(' ', $a['time_start']);
|
||||
$start_msec = $start[0];
|
||||
$start_sec = $start[1];
|
||||
|
@ -138,6 +138,9 @@ if ($protocol_version >= 2.0)
|
||||
$sl = getHttpVal('sl', '');
|
||||
$timeout = getHttpVal('timeout', '');
|
||||
$nonce = getHttpVal('nonce', '');
|
||||
|
||||
$myLog->request->set('sl', $sl);
|
||||
$myLog->request->set('timeout', $timeout);
|
||||
$myLog->request->set('nonce', $nonce);
|
||||
|
||||
/* Nonce is required from protocol 2.0 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user