mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-08 03:54:20 +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.
|
* When number of sync servers equals zero, set sync result to success.
|
||||||
Patch from arte42.ripe in issue #7.
|
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.
|
* Add files COPYING and AUTHORS.
|
||||||
|
|
||||||
* Version 2.4 released 2010-03-16
|
* Version 2.4 released 2010-03-16
|
||||||
|
@ -195,10 +195,25 @@ function retrieveURLasync ($urls, $ans_req=1, $match="^OK", $returl=False) {
|
|||||||
return $str;
|
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
|
// $otp: A yubikey OTP
|
||||||
function KSMdecryptOTP($urls) {
|
function KSMdecryptOTP($urls) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
if (!is_array($urls)) {
|
||||||
|
$response = retrieveURLsimple ($urls);
|
||||||
|
} elseif (count($urls) == 1) {
|
||||||
|
$response = retrieveURLsimple ($urls[0]);
|
||||||
|
} else {
|
||||||
$response = retrieveURLasync ($urls);
|
$response = retrieveURLasync ($urls);
|
||||||
|
}
|
||||||
if ($response) {
|
if ($response) {
|
||||||
debug("YK-KSM response: " . $response);
|
debug("YK-KSM response: " . $response);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user