mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01:52:18 +01:00
When there is only one KSM, use more portable code without async.
Patch from arte42.ripe in issue #7.
This commit is contained in:
parent
7b18b50ee7
commit
c94affd1d9
3
NEWS
3
NEWS
@ -5,6 +5,9 @@
|
||||
* When number of sync servers equals zero, set sync result to success.
|
||||
Patch from arte42.ripe in issue #7.
|
||||
|
||||
* When there is only one KSM, use more portable code without async.
|
||||
Patch from arte42.ripe in issue #7.
|
||||
|
||||
* Add files COPYING and AUTHORS.
|
||||
|
||||
* Version 2.4 released 2010-03-16
|
||||
|
@ -195,10 +195,25 @@ function retrieveURLasync ($urls, $ans_req=1, $match="^OK", $returl=False) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
function retrieveURLsimple ($url, $match="^OK") {
|
||||
foreach (file($url) as $line) {
|
||||
if (preg_match("/".$match."/", $line)) {
|
||||
return $line;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// $otp: A yubikey OTP
|
||||
function KSMdecryptOTP($urls) {
|
||||
$ret = array();
|
||||
$response = retrieveURLasync ($urls);
|
||||
if (!is_array($urls)) {
|
||||
$response = retrieveURLsimple ($urls);
|
||||
} elseif (count($urls) == 1) {
|
||||
$response = retrieveURLsimple ($urls[0]);
|
||||
} else {
|
||||
$response = retrieveURLasync ($urls);
|
||||
}
|
||||
if ($response) {
|
||||
debug("YK-KSM response: " . $response);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user