ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PK ](Êßßtests/server.incnu„[µü¤ 0) { $line = fread($sock, $content_length); fwrite($output, "$line\r\n"); } // send response fputs($sock, $file); fclose($sock); } exit(0); } function http_server_kill($pid) { posix_kill($pid, SIGTERM); pcntl_waitpid($pid, $status); } ?> PK ]%ã‹yëëtests/urlencode.phptnu„[µü¤--TEST-- OAuth urlencode --FILE-- --EXPECTF-- http%3A%2F%2Fwww.example.com http%3A%2F%2Fwww.example.com%2F~user PK ]{WÒ0ààtests/skip.incnu„[µü¤= 5.1.0 && < 5.2.6 return (PHP_MAJOR_VERSION==5) && (PHP_MINOR_VERSION==1 || (PHP_MINOR_VERSION==2 && PHP_RELEASE_VERSION<6)); } return false; } function skip_without_bug($bugid) { if (!has_bug($bugid)) { die('skip Only for bug #'.$bugid); } } function skip_with_bug($bugid) { if (has_bug($bugid)) { die('skip Not for bug #'.$bugid); } } ?>PK ]Å&ÅCtests/plaintext.phptnu„[µü¤--TEST-- OAuth plaintext --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $x->setTimestamp(12345); $x->setNonce('testing'); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_URI); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); http_server_kill($pid); ?> --EXPECTF-- array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } string(%d) "POST /test?oauth_consumer_key=conskey&oauth_signature_method=PLAINTEXT&oauth_nonce=testing&oauth_timestamp=12345&oauth_version=1.0&oauth_signature=conssecret%26 HTTP/1.%d Host: 127.0.0.1:12342 Connection: close " PK ] ¸Èee#tests/oauth_curl_debug_handler.phptnu„[µü¤--TEST-- Oauth curl debug handler --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $x->setTimestamp(12345); $x->setNonce('testing'); $x->enableDebug(); $x->setRequestEngine(OAUTH_REQENGINE_CURL); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_URI); $x->getRequestToken('http://127.0.0.1:12342/test'); fseek($output, 0, SEEK_SET); stream_get_contents($output); var_dump(count($x->debugInfo)); http_server_kill($pid); ?> --EXPECTF-- int(5) PK ]†È*mmtests/plaintext2.phptnu„[µü¤--TEST-- OAuth plaintext access token --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $x->setTimestamp(12345); $x->setNonce('testing'); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=4567&oauth_token_secret=8901", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_URI); $x->setToken("key", "secret"); var_dump($x->getAccessToken('http://127.0.0.1:12342/test')); var_dump($x->getAccessToken('http://127.0.0.1:12342/test', '', '', 'GET')); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); http_server_kill($pid); ?> --EXPECTF-- array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "4567" ["oauth_token_secret"]=> string(4) "8901" } string(%d) "POST /test?oauth_consumer_key=conskey&oauth_signature_method=PLAINTEXT&oauth_nonce=testing&oauth_timestamp=12345&oauth_version=1.0&oauth_token=key&oauth_signature=conssecret%26secret HTTP/1.%d Host: 127.0.0.1:12342 Connection: close GET /test?oauth_consumer_key=conskey&oauth_signature_method=PLAINTEXT&oauth_nonce=testing&oauth_timestamp=12345&oauth_version=1.0&oauth_token=key&oauth_signature=conssecret%26secret HTTP/1.%d Host: 127.0.0.1:12342 Connection: close " PK ]%ã‹yëëtests/oauth_urlencode.phptnu„[µü¤--TEST-- OAuth urlencode --FILE-- --EXPECTF-- http%3A%2F%2Fwww.example.com http%3A%2F%2Fwww.example.com%2F~user PK ]•“}Ò²²tests/reqtoken_php.phptnu„[µü¤--TEST-- OAuth getRequestToken --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $x->setTimestamp(12345); $x->setNonce('testing'); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_AUTHORIZATION); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_FORM); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_URI); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); http_server_kill($pid); ?> --EXPECTF-- array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } string(%d) "POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Authorization: OAuth oauth_consumer_key="1234",oauth_signature_method="HMAC-SHA1",oauth_nonce="testing",oauth_timestamp="12345",oauth_version="1.0",oauth_signature="%s" POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Content-Length: %d Content-Type: application/x-www-form-urlencoded oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=testing&oauth_timestamp=12345&oauth_version=1.0&oauth_signature=pwOAI3vHnKHd%2FLUYcJOr36Ed5Vg%3D POST /test?oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=testing&oauth_timestamp=12345&oauth_version=1.0&oauth_signature=pwOAI3vHnKHd%2FLUYcJOr36Ed5Vg%3D HTTP/%f Host: 127.0.0.1:12342 Connection: close " PK ]¤'òÙtests/oauth.incnu„[µü¤ "a_good_token", "oauth_timestamp" => "12345", "oauth_nonce" => "raNdOM", "oauth_consumer_key" => "api_key", "oauth_signature" => "invalid", "oauth_signature_method" => OAUTH_SIG_METHOD_HMACSHA1 ]; } PK ]É—Ä\\tests/bug_64308.phptnu„[µü¤--TEST-- PECL oauth: Bug #64308 (Protocol and host name not lowercased when generating signature base string) --SKIPIF-- --FILE-- --EXPECT-- GET&http%3A%2F%2Fsimonwpt.trovebox.com%2Fhello.json& PK ]74Í;| | tests/oauth_standard.phptnu„[µü¤--TEST-- OAuth Standard functions --FILE-- debug, $v->sslChecks, $v->debugInfo); return; } echo "NOT_OAUTH\n"; } echo "-- empty params --\n"; try { $x = new OAuth; } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- one param --\n"; try { $x = new OAuth(''); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- empty consumer key and secret --\n"; try { $x = new OAuth('', ''); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- empty consumer secret --\n"; try { $x = new OAuth('1234', ''); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- normal constructor --\n"; $x = new OAuth('1234', '5678'); oauth_dump($x); echo "-- enable debug --\n"; $x->enableDebug(); oauth_dump($x); echo "-- disable debug --\n"; $x->disableDebug(); oauth_dump($x); try { echo "-- set version without parameters --\n"; var_dump($x->setVersion()); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } catch (ArgumentCountError $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } try { echo "-- set version with boolean --\n"; var_dump($x->setVersion(true)); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } try { echo "-- set version with empty string --\n"; var_dump($x->setVersion('')); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- set version to 1 --\n"; var_dump($x->setVersion('1')); try { echo "-- set auth type to invalid type 99 --\n"; var_dump($x->setAuthType(99)); } catch (Exception $e) { echo "EXCEPTION {$e->getCode()}: {$e->getMessage()}\n"; } echo "-- generate a signature --\n"; var_dump(is_string($x->generateSignature('GET', 'http://www.friendface.com/foo', array('param' => 'value')))); echo "-- set a timeout (100 ms) --\n"; var_dump($x->setTimeout(100)); echo "-- set an invalid timeout --\n"; try { $x->setTimeout(-1); } catch (Exception $E) { echo "EXCEPTION {$E->getCode()}: {$E->getMessage()}\n"; } ?> --EXPECTF-- -- empty params -- EXCEPTION -1: The consumer key cannot be empty -- one param -- EXCEPTION -1: The consumer key cannot be empty -- empty consumer key and secret -- EXCEPTION -1: The consumer key cannot be empty -- empty consumer secret -- EXCEPTION -1: The consumer secret cannot be empty -- normal constructor -- OAuth[debug=0,sslChecks=3,debugInfo=] -- enable debug -- OAuth[debug=1,sslChecks=3,debugInfo=] -- disable debug -- OAuth[debug=0,sslChecks=3,debugInfo=] -- set version without parameters -- %A expects exactly 1 %A -- set version with boolean -- bool(true) -- set version with empty string -- EXCEPTION 503: Invalid version -- set version to 1 -- bool(true) -- set auth type to invalid type 99 -- EXCEPTION 503: Invalid auth type -- generate a signature -- bool(true) -- set a timeout (100 ms) -- bool(true) -- set an invalid timeout -- EXCEPTION 503: Invalid timeout PK ]>XFetttests/oauth_sbs.phptnu„[µü¤--TEST-- OAuth SBS function --FILE-- getMessage()."\n"; } echo "-- using numeric keys masked as a string --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('1'=>'hello')),"\n"; echo "-- using string keys --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('test'=>'hello')),"\n"; echo "-- using same var in url and params --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/?test=hi',array('test'=>'hello')),"\n"; echo "-- using null inside params --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('test'=>null)),"\n"; echo "-- putting oauth_signature inside by mistake --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('oauth_signature'=>'hello world')),"\n"; echo "-- merging url query and extra params --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script?arg1=1',array('arg2' => '2')),"\n"; echo "-- with array value --\n"; echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script',array('arg2' => [1, 2, 3])),"\n"; ?> --EXPECTF-- -- only two parameters -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F& -- using empty array -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F& -- using string instead of array -- %Astring given%A -- using numeric keys masked as a string -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F&1%3Dhello -- using string keys -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F&test%3Dhello -- using same var in url and params -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F&test%3Dhi -- using null inside params -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F&test%3D -- putting oauth_signature inside by mistake -- GET&http%3A%2F%2F127.0.0.1%3A12342%2F& -- merging url query and extra params -- GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg1%3D1%26arg2%3D2 -- with array value -- GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg2%3D1%26arg2%3D2%26arg2%3D3 PK ]—bBî î tests/oauth_reqtoken.phptnu„[µü¤--TEST-- OAuth getRequestToken --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_AUTHORIZATION); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_FORM); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_URI); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); var_dump($x->getRequestToken('http://127.0.0.1:12342/test', null, 'POST')); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); http_server_kill($pid); ?> --EXPECTF-- array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } string(%d) "POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Authorization: OAuth oauth_consumer_key="1234",oauth_signature_method="HMAC-SHA1",oauth_nonce="%s.%d",oauth_timestamp="%d",oauth_version="1.0",oauth_signature="%s" POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Content-Length: %d Content-Type: application/x-www-form-urlencoded oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=%s.%d&oauth_timestamp=%d&oauth_version=1.0&oauth_signature=%s POST /test?oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=%s.%d&oauth_timestamp=%d&oauth_version=1.0&oauth_signature=%s HTTP/%f Host: 127.0.0.1:12342 Connection: close POST /test?oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=%s.%d&oauth_timestamp=%d&oauth_version=1.0&oauth_signature=%s HTTP/%f Host: 127.0.0.1:12342 Connection: close " PK ][Z/íítests/test.pemnu„[µü¤-----BEGIN RSA PRIVATE KEY----- MIIBOQIBAAJBALkBSThnaneNdYKgt+r+r0Ttbm6tXpiby5ywK0SIT9Q9zuml/qIO GX9f43DgoCpK6Ju1+GjhZ5jmRD0ITUMgSx0CAwEAAQJAPoKwut42my6xBfJIMp7b me6f4cWysN3zbn4YII/uaUflGTvYwwZYMAjZjqXYNcepZQhL8g6Fclsn9IAXbqRG AQIhAPQMXKJuHjlGYHs/EhiEHuIPLaQ09f9X9TShLjeu1p3jAiEAwhCyle1J08F+ jmWbB1RqjivF6bmIXGfHUsHc5+fxwv8CIGdVGJ/56jgsEUv974aL4puq+5NMjWA5 eOx41p3jHKIrAiAKrxCl4GJoHgbxn/Zg+OzE1vQWYfh33d7DV5jpy4Mr0QIgIR95 BrFdH6fnl11HEZt2hSdvM8G1C/t0i6u5ApW/8Ko= -----END RSA PRIVATE KEY----- PK ]`Yš¶tests/reqtoken_bug44603.phptnu„[µü¤--TEST-- OAuth getRequestToken --SKIPIF-- --FILE-- setRequestEngine(OAUTH_REQENGINE_STREAMS); $pid = http_server("tcp://127.0.0.1:12342", array( "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 40\r\n\r\noauth_token=1234&oauth_token_secret=4567", ), $output); $x->setAuthType(OAUTH_AUTH_TYPE_AUTHORIZATION); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_FORM); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); $x->setAuthType(OAUTH_AUTH_TYPE_URI); var_dump($x->getRequestToken('http://127.0.0.1:12342/test')); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); http_server_kill($pid); ?> --EXPECTF-- array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } array(2) { ["oauth_token"]=> string(4) "1234" ["oauth_token_secret"]=> string(4) "4567" } string(%d) "POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Authorization: OAuth oauth_consumer_key="1234",oauth_signature_method="HMAC-SHA1",oauth_nonce="%s.%d",oauth_timestamp="%d",oauth_version="1.0",oauth_signature="%s" POST /test HTTP/%f Host: 127.0.0.1:12342 Connection: close Content-Length: %d Content-Type: application/x-www-form-urlencoded oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=%s.%d&oauth_timestamp=%d&oauth_version=1.0&oauth_signature=%s POST /test?oauth_consumer_key=1234&oauth_signature_method=HMAC-SHA1&oauth_nonce=%s.%d&oauth_timestamp=%d&oauth_version=1.0&oauth_signature=%s HTTP/%f Host: 127.0.0.1:12342 Connection: close " PK ]iÎÛùvvtests/issue019.phptnu„[µü¤--TEST-- GH issue #19 - Segfault in checkOAuthRequest() --FILE-- consumerHandler(function() use (&$ret) { foo(); }); $provider->timestampNonceHandler(function() { bar(); }); $provider->tokenHandler(function() { global $ret; baz(); }); $provider->checkOAuthRequest("http://localhost/request_token.php", OAUTH_HTTP_METHOD_GET); } catch (OAuthException $E) { echo OAuthProvider::reportProblem($E); } catch (Throwable $T) { echo "Caught ", get_class($T), "\n"; } ?> --EXPECT-- Caught Error PK ]FH((tests/bug21426.phptnu„[µü¤--TEST-- Child class of OAuth cannot access its own attributes --FILE-- foo; } } $foo = new Foo('key', 'secret'); var_dump($foo->getFoo()); ?> --EXPECTF-- string(3) "bar" PK ](Êßßtests/server.incnu„[µü¤PK ]%ã‹yëëtests/urlencode.phptnu„[µü¤PK ]{WÒ0ààNtests/skip.incnu„[µü¤PK ]Å&ÅCl tests/plaintext.phptnu„[µü¤PK ] ¸Èee#Ïtests/oauth_curl_debug_handler.phptnu„[µü¤PK ]†È*mm‡tests/plaintext2.phptnu„[µü¤PK ]%ã‹yëë9tests/oauth_urlencode.phptnu„[µü¤PK ]•“}Ò²²ntests/reqtoken_php.phptnu„[µü¤PK ]¤'òÙg&tests/oauth.incnu„[µü¤PK ]É—Ä\\¸'tests/bug_64308.phptnu„[µü¤PK ]74Í;| | X)tests/oauth_standard.phptnu„[µü¤PK ]>XFett6tests/oauth_sbs.phptnu„[µü¤PK ]—bBî î Õ>tests/oauth_reqtoken.phptnu„[µü¤PK ][Z/íí Itests/test.pemnu„[µü¤PK ]`Yš¶7Ktests/reqtoken_bug44603.phptnu„[µü¤PK ]iÎÛùvv¢Stests/issue019.phptnu„[µü¤PK ]FH(([Vtests/bug21426.phptnu„[µü¤PK¨ÆW