mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-08 03:54:20 +01:00
Refactor.
- minor improvements. - move $ret init right before it's used. - use string substitution rather than concatenation.
This commit is contained in:
parent
ef6adeb826
commit
9e81b1fd72
@ -169,11 +169,12 @@ function retrieveURLasync($ident, $urls, $logger, $ans_req=1, $match="^OK", $ret
|
||||
|
||||
while ($info = curl_multi_info_read($mh))
|
||||
{
|
||||
$logger->log(LOG_DEBUG, $ident . " curl multi info : ", $info);
|
||||
$logger->log(LOG_DEBUG, "$ident curl multi info : ", $info);
|
||||
|
||||
if ($info['result'] == CURLE_OK)
|
||||
{
|
||||
$str = curl_multi_getcontent($info['handle']);
|
||||
|
||||
$logger->log(LOG_DEBUG, "$ident curl multi content : $str");
|
||||
|
||||
if (preg_match("/$match/", $str))
|
||||
@ -227,8 +228,6 @@ function retrieveURLasync($ident, $urls, $logger, $ans_req=1, $match="^OK", $ret
|
||||
|
||||
function KSMdecryptOTP($urls, $logger, $curlopts)
|
||||
{
|
||||
$ret = array();
|
||||
|
||||
if (!is_array($urls))
|
||||
{
|
||||
$urls = array($urls);
|
||||
@ -245,6 +244,8 @@ function KSMdecryptOTP($urls, $logger, $curlopts)
|
||||
|
||||
$logger->log(LOG_DEBUG, log_format('YK-KSM response: ', $response));
|
||||
|
||||
$ret = array();
|
||||
|
||||
if (sscanf($response,
|
||||
'OK counter=%04x low=%04x high=%02x use=%02x',
|
||||
$ret['session_counter'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user