Skip to content
Snippets Groups Projects
Commit 445d2b2c authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

remove dependency on curl

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1282 44740490-163a-0410-bde0-09ae8108e29a
parent 45fd740d
No related branches found
No related tags found
No related merge requests found
...@@ -127,13 +127,9 @@ class Auth_Yubico ...@@ -127,13 +127,9 @@ class Auth_Yubico
/* Support https. */ /* Support https. */
$url = "https://api.yubico.com/wsapi/verify?" . $parameters; $url = "https://api.yubico.com/wsapi/verify?" . $parameters;
$ch = curl_init($url); $responseMsg = file_get_contents($url);
curl_setopt($ch, CURLOPT_USERAGENT, "PEAR Auth_Yubico");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$this->_response = curl_exec($ch);
curl_close($ch);
if(!preg_match("/status=([a-zA-Z0-9_]+)/", $this->_response, $out)) { if(!preg_match("/status=([a-zA-Z0-9_]+)/", $responseMsg, $out)) {
throw new Exception('Could not parse response'); throw new Exception('Could not parse response');
} }
...@@ -141,7 +137,7 @@ class Auth_Yubico ...@@ -141,7 +137,7 @@ class Auth_Yubico
/* Verify signature. */ /* Verify signature. */
if($this->_key <> "") { if($this->_key <> "") {
$rows = split("\r\n", $this->_response); $rows = split("\r\n", $responseMsg);
while (list($key, $val) = each($rows)) { while (list($key, $val) = each($rows)) {
// = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 // = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64
$val = preg_replace('/=/', '#', $val, 1); $val = preg_replace('/=/', '#', $val, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment