From a98df81417e37a0a239c3ca27621db8f907d6b12 Mon Sep 17 00:00:00 2001
From: haneul
Date: Mon, 22 Dec 2008 02:23:26 +0000
Subject: [PATCH] remove unnecesaary files
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5141 201d5d3c-b55e-5fd7-737f-ddc643e51545
---
.../Tests/Auth/OpenID/Association.php | 38 -
.../Tests/Auth/OpenID/BigMath.php | 235 --
.../Tests/Auth/OpenID/Consumer.php | 1161 ----------
.../Tests/Auth/OpenID/CryptUtil.php | 55 -
.../Tests/Auth/OpenID/DiffieHellman.php | 160 --
.../Tests/Auth/OpenID/Discover.php | 670 ------
.../Tests/Auth/OpenID/HMACSHA1.php | 148 --
.../Tests/Auth/OpenID/KVForm.php | 259 ---
.../Tests/Auth/OpenID/MemStore.php | 110 -
.../Tests/Auth/OpenID/OpenID_Yadis.php | 224 --
.../Tests/Auth/OpenID/Parse.php | 181 --
.../Tests/Auth/OpenID/Server.php | 1391 ------------
.../Tests/Auth/OpenID/StoreTest.php | 574 -----
.../Tests/Auth/OpenID/TestUtil.php | 28 -
.../Tests/Auth/OpenID/TrustRoot.php | 167 --
.../Tests/Auth/OpenID/URINorm.php | 68 -
.../Tests/Auth/OpenID/Util.php | 260 ---
.../Tests/Auth/OpenID/data/dhexch | 25 -
.../Tests/Auth/OpenID/data/dhpriv | 29 -
.../Tests/Auth/OpenID/data/hmac.txt | 49 -
.../Tests/Auth/OpenID/data/linkparse.txt | 594 -----
.../Tests/Auth/OpenID/data/n2b64 | 650 ------
.../Tests/Auth/OpenID/data/trustroot.txt | 120 -
.../Tests/Auth/OpenID/data/urinorm.txt | 79 -
.../Tests/Services/Yadis/Discover.php | 171 --
.../Tests/Services/Yadis/DiscoverData.php | 148 --
.../Tests/Services/Yadis/ParseHTML.php | 88 -
.../Tests/Services/Yadis/TestUtil.php | 28 -
.../Tests/Services/Yadis/XRDS.php | 241 --
.../Tests/Services/Yadis/XRI.php | 141 --
.../Tests/Services/Yadis/Yadis.php | 91 -
.../Tests/Services/Yadis/data/README | 12 -
.../Tests/Services/Yadis/data/accept.txt | 118 -
.../Services/Yadis/data/brian.multi.xrds | 38 -
.../Services/Yadis/data/brian.multi_uri.xrds | 16 -
.../Tests/Services/Yadis/data/brian.xrds | 16 -
.../Services/Yadis/data/brian_priority.xrds | 22 -
.../Yadis/data/delegated-20060809-r1.xrds | 34 -
.../Yadis/data/delegated-20060809-r2.xrds | 34 -
.../Yadis/data/delegated-20060809.xrds | 34 -
.../Services/Yadis/data/example-xrds.xml | 14 -
.../Tests/Services/Yadis/data/manifest.txt | 30 -
.../Tests/Services/Yadis/data/no-xrd.xml | 7 -
.../Tests/Services/Yadis/data/not-xrds.xml | 2 -
.../Tests/Services/Yadis/data/pip.xrds | 22 -
.../Services/Yadis/data/prefixsometimes.xrds | 34 -
.../Tests/Services/Yadis/data/ref.xrds | 109 -
.../Services/Yadis/data/sometimesprefix.xrds | 34 -
.../Tests/Services/Yadis/data/spoof1.xrds | 25 -
.../Tests/Services/Yadis/data/spoof2.xrds | 25 -
.../Tests/Services/Yadis/data/spoof3.xrds | 37 -
.../Services/Yadis/data/test1-discover.txt | 137 --
.../Services/Yadis/data/test1-parsehtml.txt | 133 --
.../Tests/Services/Yadis/data/test1-xrd.xml | 39 -
.../Services/Yadis/data/uri_priority.xrds | 16 -
.../php-openid-1.2.3/Tests/TestDriver.php | 189 --
.../php-openid-1.2.3/admin/adminutil.php | 30 -
.../php-openid-1.2.3/admin/brace_style.pl | 81 -
.../member/php-openid-1.2.3/admin/checkimport | 4 -
.../php-openid-1.2.3/admin/checkimports | 2 -
.../php-openid-1.2.3/admin/darcs-ignore | 3 -
.../member/php-openid-1.2.3/admin/docblocks | 15 -
.../php-openid-1.2.3/admin/docblocks.pl | 26 -
.../member/php-openid-1.2.3/admin/findglobals | 5 -
modules/member/php-openid-1.2.3/admin/findphp | 8 -
.../member/php-openid-1.2.3/admin/fixperms | 13 -
.../php-openid-1.2.3/admin/library-name | 1 -
.../php-openid-1.2.3/admin/longlines.pl | 46 -
.../member/php-openid-1.2.3/admin/makedoc.sh | 5 -
modules/member/php-openid-1.2.3/admin/mathlib | 18 -
.../member/php-openid-1.2.3/admin/nobadbraces | 4 -
.../member/php-openid-1.2.3/admin/nobadcase | 14 -
.../member/php-openid-1.2.3/admin/nolonglines | 16 -
modules/member/php-openid-1.2.3/admin/notabs | 16 -
.../member/php-openid-1.2.3/admin/open_tag | 17 -
.../php-openid-1.2.3/admin/otb_test.php | 20 -
.../member/php-openid-1.2.3/admin/package.xml | 24 -
.../php-openid-1.2.3/admin/package2.xml | 74 -
.../php-openid-1.2.3/admin/packagexml.py | 155 --
.../php-openid-1.2.3/admin/phpaliases.py | 119 -
.../php-openid-1.2.3/admin/prepare-release | 12 -
.../member/php-openid-1.2.3/admin/runtests | 64 -
.../php-openid-1.2.3/admin/texttest.php | 173 --
.../admin/tutorials/OpenID/OpenID.pkg | 81 -
.../member/php-openid-1.2.3/admin/webtest.php | 12 -
.../php-openid-1.2.3/admin/xmlconfig.py | 55 -
.../doc/OpenID/Auth_OpenID_AlreadySigned.html | 68 -
.../doc/OpenID/Auth_OpenID_Association.html | 210 --
.../doc/OpenID/Auth_OpenID_AuthRequest.html | 187 --
.../OpenID/Auth_OpenID_CancelResponse.html | 169 --
.../doc/OpenID/Auth_OpenID_Consumer.html | 216 --
.../OpenID/Auth_OpenID_ConsumerResponse.html | 153 --
.../Auth_OpenID_DatabaseConnection.html | 337 ---
.../doc/OpenID/Auth_OpenID_Decoder.html | 160 --
...h_OpenID_DiffieHellmanConsumerSession.html | 217 --
...uth_OpenID_DiffieHellmanServerSession.html | 226 --
.../doc/OpenID/Auth_OpenID_DumbStore.html | 419 ----
.../doc/OpenID/Auth_OpenID_Encoder.html | 200 --
.../doc/OpenID/Auth_OpenID_EncodingError.html | 129 --
.../OpenID/Auth_OpenID_FailureResponse.html | 172 --
.../doc/OpenID/Auth_OpenID_FileStore.html | 528 -----
.../Auth_OpenID_MalformedReturnURL.html | 118 -
.../Auth_OpenID_MalformedTrustRoot.html | 116 -
.../doc/OpenID/Auth_OpenID_MySQLStore.html | 128 --
.../doc/OpenID/Auth_OpenID_OpenIDStore.html | 550 -----
.../Auth_OpenID_PlainTextConsumerSession.html | 186 --
.../Auth_OpenID_PlainTextServerSession.html | 192 --
.../OpenID/Auth_OpenID_PostgreSQLStore.html | 128 --
.../doc/OpenID/Auth_OpenID_SQLStore.html | 720 ------
.../doc/OpenID/Auth_OpenID_SQLiteStore.html | 175 --
.../doc/OpenID/Auth_OpenID_Server.html | 202 --
.../doc/OpenID/Auth_OpenID_ServerError.html | 255 ---
.../doc/OpenID/Auth_OpenID_ServerRequest.html | 101 -
.../Auth_OpenID_SetupNeededResponse.html | 172 --
.../doc/OpenID/Auth_OpenID_Signatory.html | 381 ----
.../OpenID/Auth_OpenID_SigningEncoder.html | 179 --
.../OpenID/Auth_OpenID_SuccessResponse.html | 201 --
.../Auth_OpenID_UntrustedReturnURL.html | 150 --
.../doc/OpenID/Auth_OpenID_WebResponse.html | 189 --
.../_Auth---OpenID---Association.php.html | 67 -
.../OpenID/_Auth---OpenID---Consumer.php.html | 382 ----
...uth---OpenID---DatabaseConnection.php.html | 66 -
.../_Auth---OpenID---DumbStore.php.html | 109 -
.../_Auth---OpenID---FileStore.php.html | 123 -
.../_Auth---OpenID---Interface.php.html | 67 -
.../_Auth---OpenID---MySQLStore.php.html | 89 -
.../_Auth---OpenID---PostgreSQLStore.php.html | 89 -
.../OpenID/_Auth---OpenID---SQLStore.php.html | 96 -
.../_Auth---OpenID---SQLiteStore.php.html | 89 -
.../OpenID/_Auth---OpenID---Server.php.html | 354 ---
.../_Auth---OpenID---ServerRequest.php.html | 99 -
.../doc/OpenID/_Auth---OpenID.php.html | 275 ---
.../doc/OpenID/tutorial_OpenID.pkg.html | 52 -
.../Auth_OpenID_ServiceEndpointLoader.html | 186 --
.../doc/Yadis/Services_Yadis_Discovery.html | 175 --
.../doc/Yadis/Services_Yadis_Manager.html | 99 -
.../Yadis/Services_Yadis_ManagerLoader.html | 260 ---
.../doc/Yadis/Services_Yadis_PHPSession.html | 203 --
.../doc/Yadis/Services_Yadis_Service.html | 225 --
.../Yadis/Services_Yadis_SessionLoader.html | 333 ---
.../doc/Yadis/Services_Yadis_XMLParser.html | 374 ---
.../doc/Yadis/Services_Yadis_XRDS.html | 184 --
.../doc/Yadis/Services_Yadis_Yadis.html | 258 ---
.../doc/Yadis/Services_Yadis_dom.html | 303 ---
.../doc/Yadis/Services_Yadis_domxml.html | 303 ---
.../_Services---Yadis---Manager.php.html | 101 -
.../Yadis/_Services---Yadis---XML.php.html | 160 --
.../Yadis/_Services---Yadis---XRDS.php.html | 200 --
.../Yadis/_Services---Yadis---Yadis.php.html | 139 --
.../doc/classtrees_OpenID.html | 104 -
.../doc/classtrees_Yadis.html | 56 -
.../php-openid-1.2.3/doc/elementindex.html | 1998 -----------------
.../doc/elementindex_OpenID.html | 1473 ------------
.../doc/elementindex_Yadis.html | 680 ------
.../member/php-openid-1.2.3/doc/errors.html | 35 -
.../member/php-openid-1.2.3/doc/index.html | 24 -
.../php-openid-1.2.3/doc/li_OpenID.html | 90 -
.../member/php-openid-1.2.3/doc/li_Yadis.html | 53 -
.../php-openid-1.2.3/doc/media/banner.css | 32 -
.../php-openid-1.2.3/doc/media/stylesheet.css | 142 --
.../member/php-openid-1.2.3/doc/packages.html | 34 -
.../member/php-openid-1.2.3/examples/README | 122 -
.../examples/consumer/common.php | 41 -
.../examples/consumer/finish_auth.php | 38 -
.../examples/consumer/index.php | 59 -
.../examples/consumer/try_auth.php | 48 -
.../php-openid-1.2.3/examples/detect.php | 496 ----
.../examples/server/index.php | 5 -
.../examples/server/lib/actions.php | 169 --
.../examples/server/lib/common.php | 63 -
.../examples/server/lib/render.php | 112 -
.../examples/server/lib/render/about.php | 58 -
.../examples/server/lib/render/login.php | 65 -
.../examples/server/lib/render/sites.php | 83 -
.../examples/server/lib/render/trust.php | 29 -
.../examples/server/lib/session.php | 205 --
.../examples/server/openid-server.css | 74 -
.../examples/server/server.php | 45 -
.../examples/server/setup.php | 690 ------
179 files changed, 30590 deletions(-)
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Association.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/BigMath.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Consumer.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/CryptUtil.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/DiffieHellman.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Discover.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/HMACSHA1.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/KVForm.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/MemStore.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/OpenID_Yadis.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Parse.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Server.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/StoreTest.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/TestUtil.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/TrustRoot.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/URINorm.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Util.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhexch
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhpriv
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/hmac.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/linkparse.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/n2b64
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/trustroot.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/urinorm.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/Discover.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/DiscoverData.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/ParseHTML.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/TestUtil.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/XRDS.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/XRI.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/Yadis.php
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/README
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/accept.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/brian.multi.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/brian.multi_uri.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/brian.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/brian_priority.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/delegated-20060809-r1.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/delegated-20060809-r2.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/delegated-20060809.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/example-xrds.xml
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/manifest.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/no-xrd.xml
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/not-xrds.xml
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/pip.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/prefixsometimes.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/ref.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/sometimesprefix.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/spoof1.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/spoof2.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/spoof3.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/test1-discover.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/test1-parsehtml.txt
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/test1-xrd.xml
delete mode 100644 modules/member/php-openid-1.2.3/Tests/Services/Yadis/data/uri_priority.xrds
delete mode 100644 modules/member/php-openid-1.2.3/Tests/TestDriver.php
delete mode 100644 modules/member/php-openid-1.2.3/admin/adminutil.php
delete mode 100644 modules/member/php-openid-1.2.3/admin/brace_style.pl
delete mode 100644 modules/member/php-openid-1.2.3/admin/checkimport
delete mode 100644 modules/member/php-openid-1.2.3/admin/checkimports
delete mode 100644 modules/member/php-openid-1.2.3/admin/darcs-ignore
delete mode 100644 modules/member/php-openid-1.2.3/admin/docblocks
delete mode 100644 modules/member/php-openid-1.2.3/admin/docblocks.pl
delete mode 100644 modules/member/php-openid-1.2.3/admin/findglobals
delete mode 100644 modules/member/php-openid-1.2.3/admin/findphp
delete mode 100644 modules/member/php-openid-1.2.3/admin/fixperms
delete mode 100644 modules/member/php-openid-1.2.3/admin/library-name
delete mode 100644 modules/member/php-openid-1.2.3/admin/longlines.pl
delete mode 100644 modules/member/php-openid-1.2.3/admin/makedoc.sh
delete mode 100644 modules/member/php-openid-1.2.3/admin/mathlib
delete mode 100644 modules/member/php-openid-1.2.3/admin/nobadbraces
delete mode 100644 modules/member/php-openid-1.2.3/admin/nobadcase
delete mode 100644 modules/member/php-openid-1.2.3/admin/nolonglines
delete mode 100644 modules/member/php-openid-1.2.3/admin/notabs
delete mode 100644 modules/member/php-openid-1.2.3/admin/open_tag
delete mode 100644 modules/member/php-openid-1.2.3/admin/otb_test.php
delete mode 100644 modules/member/php-openid-1.2.3/admin/package.xml
delete mode 100644 modules/member/php-openid-1.2.3/admin/package2.xml
delete mode 100644 modules/member/php-openid-1.2.3/admin/packagexml.py
delete mode 100644 modules/member/php-openid-1.2.3/admin/phpaliases.py
delete mode 100644 modules/member/php-openid-1.2.3/admin/prepare-release
delete mode 100644 modules/member/php-openid-1.2.3/admin/runtests
delete mode 100644 modules/member/php-openid-1.2.3/admin/texttest.php
delete mode 100644 modules/member/php-openid-1.2.3/admin/tutorials/OpenID/OpenID.pkg
delete mode 100644 modules/member/php-openid-1.2.3/admin/webtest.php
delete mode 100644 modules/member/php-openid-1.2.3/admin/xmlconfig.py
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_AlreadySigned.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Association.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_AuthRequest.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_CancelResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Consumer.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_ConsumerResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_DatabaseConnection.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Decoder.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_DiffieHellmanConsumerSession.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_DiffieHellmanServerSession.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_DumbStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Encoder.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_EncodingError.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_FailureResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_FileStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_MalformedReturnURL.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_MalformedTrustRoot.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_MySQLStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_OpenIDStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_PlainTextConsumerSession.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_PlainTextServerSession.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_PostgreSQLStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_SQLStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_SQLiteStore.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Server.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_ServerError.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_ServerRequest.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_SetupNeededResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_Signatory.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_SigningEncoder.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_SuccessResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_UntrustedReturnURL.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/Auth_OpenID_WebResponse.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---Association.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---Consumer.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---DatabaseConnection.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---DumbStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---FileStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---Interface.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---MySQLStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---PostgreSQLStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---SQLStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---SQLiteStore.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---Server.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID---ServerRequest.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/_Auth---OpenID.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/OpenID/tutorial_OpenID.pkg.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Auth_OpenID_ServiceEndpointLoader.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_Discovery.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_Manager.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_ManagerLoader.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_PHPSession.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_Service.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_SessionLoader.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_XMLParser.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_XRDS.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_Yadis.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_dom.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/Services_Yadis_domxml.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/_Services---Yadis---Manager.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/_Services---Yadis---XML.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/_Services---Yadis---XRDS.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/Yadis/_Services---Yadis---Yadis.php.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/classtrees_OpenID.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/classtrees_Yadis.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/elementindex.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/elementindex_OpenID.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/elementindex_Yadis.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/errors.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/index.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/li_OpenID.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/li_Yadis.html
delete mode 100644 modules/member/php-openid-1.2.3/doc/media/banner.css
delete mode 100644 modules/member/php-openid-1.2.3/doc/media/stylesheet.css
delete mode 100644 modules/member/php-openid-1.2.3/doc/packages.html
delete mode 100644 modules/member/php-openid-1.2.3/examples/README
delete mode 100644 modules/member/php-openid-1.2.3/examples/consumer/common.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/consumer/finish_auth.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/consumer/index.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/consumer/try_auth.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/detect.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/index.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/actions.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/common.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/render.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/render/about.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/render/login.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/render/sites.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/render/trust.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/lib/session.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/openid-server.css
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/server.php
delete mode 100644 modules/member/php-openid-1.2.3/examples/server/setup.php
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Association.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Association.php
deleted file mode 100644
index fcdda0da6..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Association.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/Association.php';
-
-class Tests_Auth_OpenID_Association extends PHPUnit_TestCase {
- function test_me()
- {
- $issued = time();
- $lifetime = 600;
- $assoc = new Auth_OpenID_Association('handle', 'secret', $issued,
- $lifetime, 'HMAC-SHA1');
- $s = $assoc->serialize();
- $assoc2 = Auth_OpenID_Association::deserialize(
- 'Auth_OpenID_Association', $s);
-
- if ($assoc2 === null) {
- $this->fail('deserialize returned null');
- } else {
- $this->assertTrue($assoc2->equal($assoc));
- }
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/BigMath.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/BigMath.php
deleted file mode 100644
index a5dbac21c..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/BigMath.php
+++ /dev/null
@@ -1,235 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/BigMath.php';
-require_once 'Tests/Auth/OpenID/TestUtil.php';
-
-class Tests_Auth_OpenID_BinLongConvertRnd extends PHPUnit_TestCase {
- var $lib;
- var $max;
-
- function Tests_Auth_OpenID_BinLongConvertRnd(&$lib, $max)
- {
- $this->lib =& $lib;
- $this->max = $max;
- }
-
- function runTest()
- {
- $n = $this->lib->init(0);
- foreach (range(0, 9) as $i) {
- $rnd = $this->lib->rand($this->max);
- $n = $this->lib->add($n, $rnd);
- }
- $s = $this->lib->longToBinary($n);
- $this->assertTrue(is_string($s));
- $n_prime = $this->lib->binaryToLong($s);
- $this->assertEquals($this->lib->cmp($n, $n_prime), 0);
- }
-}
-
-class Tests_Auth_OpenID_BinLongConvert extends PHPUnit_TestCase {
- var $lib;
- var $bin;
- var $lng;
-
- function Tests_Auth_OpenID_BinLongConvert(&$lib, $bin, $lng)
- {
- $this->lib =& $lib;
- $this->bin = $bin;
- $this->lng = $lng;
- }
-
- function runTest()
- {
- $n_prime = $this->lib->binaryToLong($this->bin);
- $s_prime = $this->lib->longToBinary($this->lng);
- $this->assertEquals($this->lib->cmp($this->lng, $n_prime), 0);
- $this->assertTrue($this->bin == $s_prime);
- }
-}
-
-class Tests_Auth_OpenID_Base64ToLong extends PHPUnit_TestCase {
- var $num;
- var $b64;
- var $lib;
-
- function Tests_Auth_OpenID_Base64ToLong(&$lib, $b64, $num)
- {
- $this->lib = $lib;
- $this->b64 = $b64;
- $this->num = $num;
- }
-
- function runTest()
- {
- $actual = $this->lib->base64ToLong($this->b64);
- $this->assertTrue($this->lib->cmp($this->num, $actual) == 0);
- }
-}
-
-class Tests_Auth_OpenID_LongToBase64 extends Tests_Auth_OpenID_Base64ToLong {
- function Tests_Auth_OpenID_LongToBase64(&$lib, $b64, $num)
- {
- $this->lib = $lib;
- $this->b64 = $b64;
- $this->num = $num;
- }
-
- function runTest()
- {
- $actual = $this->lib->longToBase64($this->num);
- $this->assertEquals($this->b64, $actual);
- }
-}
-
-class Tests_Auth_OpenID_Rand extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_Rand(&$lib)
- {
- $this->lib =& $lib;
- }
-
- function runTest()
- {
- $stop = $this->lib->pow(2, 128);
- $a = $this->lib->rand($stop);
- $b = $this->lib->rand($stop);
-
- $this->assertFalse($this->lib->cmp($b, $a) == 0, "Same: $a $b");
-
- $n = $this->lib->init(Tests_Auth_OpenID_maxint());
- $n = $this->lib->add($n, 1);
-
- // Make sure that we can generate random numbers that are
- // larger than platform int size
- $result = $this->lib->rand($n);
-
- // What can we say about the result?
- }
-}
-
-/**
- * Computes the maximum integer value for this PHP installation.
- *
- * @return int $max_int_value The maximum integer value for this
- * PHP installation
- */
-function Tests_Auth_OpenID_maxint()
-{
- /* assumes largest integer is of form 2^n - 1 */
- $to_test = pow(2, 16);
- while (1) {
- $last = $to_test;
- $to_test = 2 * $to_test;
- if (($to_test < $last) || (!is_int($to_test))) {
- return($last + ($last - 1));
- }
- }
-}
-
-
-class Tests_Auth_OpenID_BigMath extends PHPUnit_TestSuite {
- function _parseBase64Data()
- {
- $lines = Tests_Auth_OpenID_readlines('n2b64');
-
- $data = array();
- foreach ($lines as $line) {
- $line = trim($line);
- if (!$line) {
- continue;
- }
- list($b64, $ascii) = explode(' ', $line);
- $data[$b64] = $ascii;
- }
- return $data;
- }
-
- function _addB64Tests()
- {
- $lib =& Auth_OpenID_getMathLib();
- $count = defined('Tests_Auth_OpenID_thorough') ? -1 : 2;
- $data = $this->_parseBase64Data();
- foreach ($data as $b64 => $num_s) {
- // Only test the first few unless thorough is defined
- if (strlen($num_s) > 5) {
- if ($count == 0) {
- break;
- } else {
- $count -= 1;
- }
- }
- $num = $lib->init($num_s);
- $test = new Tests_Auth_OpenID_Base64ToLong($lib, $b64, $num);
- $test->setName("B64->Long $num_s");
- $this->addTest($test);
-
- $test = new Tests_Auth_OpenID_LongToBase64($lib, $b64, $num);
- $test->setName("Long->B64 $num_s");
- $this->addTest($test);
- }
- }
-
- function _addBinLongTests()
- {
- $lib =& Auth_OpenID_getMathLib();
- $max = Tests_Auth_OpenID_maxint();
- $upper = defined('Tests_Auth_OpenID_thorough') ? 499 : 3;
-
- foreach (range(0, $upper) as $iteration) {
- $test = new Tests_Auth_OpenID_BinLongConvertRnd($lib, $max);
- $test->setName("BinLongConvertRnd " . strval($iteration));
- $this->addTest($test);
- }
-
- $cases = array(
- array("\x00", 0),
- array("\x01", 1),
- array("\x7F", 127),
- array("\x00\x80", 128),
- array("\x00\x81", 129),
- array("\x00\xFF", 255),
- array("\x00\x80\x00", 32768),
- array("OpenID is cool",
- "1611215304203901150134421257416556")
- );
-
- foreach ($cases as $case) {
- list($bin, $lng_m) = $case;
- $lng = $lib->init($lng_m);
- $test = new Tests_Auth_OpenID_BinLongConvert($lib, $bin, $lng);
- $test->setName('BinLongConvert ' . bin2hex($bin));
- $this->addTest($test);
- }
-
- }
-
- function Tests_Auth_OpenID_BigMath($name)
- {
- $this->setName($name);
-
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $this->addTestSuite('Tests_Auth_OpenID_BigInt');
- $this->_addB64Tests();
- $this->_addBinLongTests();
- $test = new Tests_Auth_OpenID_Rand(Auth_OpenID_getMathLib());
- $test->setName('Big number rand');
- $this->addTest($test);
- }
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Consumer.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Consumer.php
deleted file mode 100644
index f9e2772d5..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Consumer.php
+++ /dev/null
@@ -1,1161 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-session_start();
-
-require_once 'Auth/OpenID/CryptUtil.php';
-require_once 'Services/Yadis/HTTPFetcher.php';
-require_once 'Auth/OpenID/DiffieHellman.php';
-require_once 'Auth/OpenID/FileStore.php';
-require_once 'Auth/OpenID/KVForm.php';
-require_once 'Auth/OpenID/Consumer.php';
-require_once 'Auth/OpenID/Server.php';
-require_once 'Tests/Auth/OpenID/MemStore.php';
-require_once 'PHPUnit.php';
-
-class Auth_OpenID_TestConsumer extends Auth_OpenID_GenericConsumer {
- /**
- * Use a small (insecure) modulus for this test so that it runs quickly
- */
- function _createDiffieHellman()
- {
- return new Auth_OpenID_DiffieHellman('1235514290909');
- }
-}
-
-$_Auth_OpenID_assocs = array(
- array('another 20-byte key.', 'Snarky'),
- array(str_repeat("\x00", 20), 'Zeros'),
- );
-
-function Auth_OpenID_parse($qs)
-{
- $result = array();
- $parts = explode("&", $qs);
- foreach ($parts as $pair) {
- list($key, $value) = explode("=", $pair, 2);
- assert(!array_key_exists($key, $result));
- $result[$key] = urldecode($value);
- }
- return $result;
-}
-
-function Auth_OpenID_associate($qs, $assoc_secret, $assoc_handle)
-{
- $query_data = Auth_OpenID_parse($qs);
-
- assert((count($query_data) == 6) || (count($query_data) == 4));
- assert($query_data['openid.mode'] == 'associate');
- assert($query_data['openid.assoc_type'] == 'HMAC-SHA1');
- assert($query_data['openid.session_type'] == 'DH-SHA1');
-
- $reply_dict = array(
- 'assoc_type' => 'HMAC-SHA1',
- 'assoc_handle' => $assoc_handle,
- 'expires_in' => '600',
- );
-
- $dh_args = Auth_OpenID_DiffieHellman::
- serverAssociate($query_data, $assoc_secret);
-
- $reply_dict = array_merge($reply_dict, $dh_args);
-
- return Auth_OpenID_KVForm::fromArray($reply_dict);
-}
-
-class Auth_OpenID_TestFetcher extends Services_Yadis_HTTPFetcher {
- function Auth_OpenID_TestFetcher($user_url, $user_page,
- $assoc_secret, $assoc_handle)
- {
- $this->get_responses = array($user_url =>
- new Services_Yadis_HTTPResponse($user_url,
- 200,
- array(),
- $user_page));
- $this->assoc_secret = $assoc_secret;
- $this->assoc_handle = $assoc_handle;
- $this->num_assocs = 0;
- }
-
- function response($url, $body)
- {
- if ($body === null) {
- return new Services_Yadis_HTTPResponse($url, 404, array(), 'Not found');
- } else {
- return new Services_Yadis_HTTPResponse($url, 200, array(), $body);
- }
- }
-
- function get($url)
- {
- if (array_key_exists($url, $this->get_responses)) {
- return $this->get_responses[$url];
- } else {
- return $this->response($url, null);
- }
- }
-
- function _checkAuth($url, $body)
- {
- $query_data = Auth_OpenID_parse($body);
- $expected = array(
- 'openid.mode' => 'check_authentication',
- 'openid.signed' => 'assoc_handle,sig,signed',
- 'openid.sig' => 'fake',
- 'openid.assoc_handle' => $this->assoc_handle,
- );
-
- if ($query_data == $expected) {
- return new Services_Yadis_HTTPResponse($url, 200, array(), "is_valid:true\n");
- } else {
- return new Services_Yadis_HTTPResponse($url, 400, array(),
- "error:bad check_authentication query\n");
- }
- }
-
- function post($url, $body)
- {
- if (strpos($body, 'openid.mode=associate') !== false) {
- $response = Auth_OpenID_associate($body, $this->assoc_secret,
- $this->assoc_handle);
- $this->num_assocs++;
- return $this->response($url, $response);
- } elseif (strpos($body, 'openid.mode=check_authentication') !== false) {
- return $this->_checkAuth($url, $body);
- } else {
- return $this->response($url, null);
- }
- }
-}
-
-$_Auth_OpenID_user_page_pat = "
-
- A user page
- %s
-
-
- blah blah
-
-";
-
-$_Auth_OpenID_server_url = "http://server.example.com/";
-$_Auth_OpenID_consumer_url = "http://consumer.example.com/";
-
-class Tests_Auth_OpenID_Consumer extends PHPUnit_TestCase {
-
- function _run(&$consumer, $user_url, $mode, $delegate_url,
- &$fetcher, &$store, $immediate)
- {
- global $_Auth_OpenID_consumer_url,
- $_Auth_OpenID_server_url;
-
- $endpoint = new Auth_OpenID_ServiceEndpoint();
- $endpoint->identity_url = $user_url;
- $endpoint->server_url = $_Auth_OpenID_server_url;
- $endpoint->delegate = $delegate_url;
-
- $result = $consumer->begin($endpoint);
-
- $return_to = $_Auth_OpenID_consumer_url;
- $trust_root = $_Auth_OpenID_consumer_url;
- $redirect_url = $result->redirectURL($trust_root, $return_to,
- $immediate);
-
- $parsed = parse_url($redirect_url);
- $qs = $parsed['query'];
- $q = Auth_OpenID_parse($qs);
- $new_return_to = $q['openid.return_to'];
- unset($q['openid.return_to']);
-
- $expected = array(
- 'openid.mode' => $mode,
- 'openid.identity' => $delegate_url,
- 'openid.trust_root' => $trust_root
- );
-
- if ($consumer->_use_assocs) {
- $expected['openid.assoc_handle'] = $fetcher->assoc_handle;
- }
-
- $this->assertEquals($expected, $q);
- $this->assertEquals(0, strpos($redirect_url, $_Auth_OpenID_server_url));
- $this->assertEquals(0, strpos($new_return_to, $return_to));
-
- $query = array(
- 'nonce' => $result->return_to_args['nonce'],
- 'openid.mode'=> 'id_res',
- 'openid.return_to'=> $new_return_to,
- 'openid.identity'=> $delegate_url,
- 'openid.assoc_handle'=> $fetcher->assoc_handle,
- );
-
- if ($consumer->_use_assocs) {
- $assoc = $store->getAssociation($_Auth_OpenID_server_url,
- $fetcher->assoc_handle);
-
- $assoc->addSignature(array('mode', 'return_to', 'identity'),
- $query);
- } else {
- $query['openid.signed'] =
- 'assoc_handle,sig,signed';
- $query['openid.assoc_handle'] = $fetcher->assoc_handle;
- $query['openid.sig'] = 'fake';
- }
-
- $result = $consumer->complete($query, $result->endpoint);
-
- $this->assertEquals($result->status, 'success');
- $this->assertEquals($result->identity_url, $user_url);
- }
-
- function _test_success($user_url, $delegate_url, $links, $immediate = false)
- {
- global $_Auth_OpenID_filestore_base_dir,
- $_Auth_OpenID_server_url,
- $_Auth_OpenID_user_page_pat,
- $_Auth_OpenID_assocs;
-
- $store = new Tests_Auth_OpenID_MemStore();
-
- if ($immediate) {
- $mode = 'checkid_immediate';
- } else {
- $mode = 'checkid_setup';
- }
-
- $user_page = sprintf($_Auth_OpenID_user_page_pat, $links);
- $fetcher = new Auth_OpenID_TestFetcher($user_url, $user_page,
- $_Auth_OpenID_assocs[0][0],
- $_Auth_OpenID_assocs[0][1]);
-
- $consumer = new Auth_OpenID_TestConsumer($store);
- $consumer->fetcher =& $fetcher;
-
- $expected_num_assocs = 0;
- $this->assertEquals($expected_num_assocs, $fetcher->num_assocs);
- $this->_run($consumer, $user_url, $mode, $delegate_url,
- $fetcher, $store, $immediate);
-
- if ($consumer->_use_assocs) {
- $expected_num_assocs += 1;
- }
-
- $this->assertEquals($expected_num_assocs, $fetcher->num_assocs);
-
- // Test that doing it again uses the existing association
- $this->_run($consumer, $user_url, $mode, $delegate_url,
- $fetcher, $store, $immediate);
-
- $this->assertEquals($expected_num_assocs, $fetcher->num_assocs);
-
- // Another association is created if we remove the existing one
- $store->removeAssociation($_Auth_OpenID_server_url,
- $fetcher->assoc_handle);
-
- $this->_run($consumer, $user_url, $mode, $delegate_url,
- $fetcher, $store, $immediate);
-
- if ($consumer->_use_assocs) {
- $expected_num_assocs += 1;
- }
-
- $this->assertEquals($expected_num_assocs, $fetcher->num_assocs);
-
- // Test that doing it again uses the existing association
- $this->_run($consumer, $user_url, $mode, $delegate_url,
- $fetcher, $store, $immediate);
-
- $this->assertEquals($expected_num_assocs, $fetcher->num_assocs);
- }
-
- function test_success()
- {
- global $_Auth_OpenID_server_url;
-
- $user_url = 'http://www.example.com/user.html';
- $links = sprintf(' ',
- $_Auth_OpenID_server_url);
-
- $delegate_url = 'http://consumer.example.com/user';
- $delegate_links = sprintf(' '.
- ' ',
- $_Auth_OpenID_server_url, $delegate_url);
-
- $this->_test_success($user_url, $user_url, $links);
- $this->_test_success($user_url, $user_url, $links, true);
- $this->_test_success($user_url, $delegate_url, $delegate_links);
- $this->_test_success($user_url, $delegate_url, $delegate_links, true);
- }
-}
-
-class _TestIdRes extends PHPUnit_TestCase {
- var $consumer_class = 'Auth_OpenID_GenericConsumer';
-
- function setUp()
- {
- $this->store = new Tests_Auth_OpenID_MemStore();
- $cl = $this->consumer_class;
- $this->consumer = new $cl($this->store);
- $this->return_to = "nonny";
- $this->endpoint = new Auth_OpenID_ServiceEndpoint();
-
- $this->server_id = "sirod";
- $this->server_url = "serlie";
- $this->consumer_id = "consu";
-
- $this->endpoint->identity_url = $this->consumer_id;
- $this->endpoint->server_url = $this->server_url;
- $this->endpoint->delegate = $this->server_id;
- }
-}
-
-class Tests_Auth_OpenID_Consumer_TestSetupNeeded extends _TestIdRes {
- function test_setupNeeded()
- {
- $setup_url = "http://unittest/setup-here";
- $query = array(
- 'openid.mode' => 'id_res',
- 'openid.user_setup_url' => $setup_url);
- $ret = $this->consumer->_doIdRes($query, $this->endpoint);
- $this->assertEquals($ret->status, Auth_OpenID_SETUP_NEEDED);
- $this->assertEquals($ret->setup_url, $setup_url);
- }
-}
-
-define('E_CHECK_AUTH_HAPPENED', 'checkauth occurred');
-define('E_MOCK_FETCHER_EXCEPTION', 'mock fetcher exception');
-define('E_ASSERTION_ERROR', 'assertion error');
-
-class _CheckAuthDetectingConsumer extends Auth_OpenID_GenericConsumer {
- function _checkAuth($query, $server_url)
- {
- __raiseError(E_CHECK_AUTH_HAPPENED);
- }
-}
-
-class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes {
- function setUp()
- {
- parent::setUp();
- $this->nonce = "t3stn0nc3";
- $this->store->storeNonce($this->nonce);
- }
-
- function test_goodNonce()
- {
- $this->return_to = sprintf('http://rt.unittest/?nonce=%s',
- $this->nonce);
- $this->response = new Auth_OpenID_SuccessResponse($this->endpoint,
- array('openid.return_to' => $this->return_to));
-
- $ret = $this->consumer->_checkNonce($this->response, $this->nonce);
- $this->assertEquals($ret->status, Auth_OpenID_SUCCESS);
- $this->assertEquals($ret->identity_url, $this->consumer_id);
- }
-
- function test_badNonce()
- {
- // remove the nonce from the store
- $this->store->useNonce($this->nonce);
- $this->return_to = sprintf('http://rt.unittest/?nonce=%s',
- $this->nonce);
- $this->response = new Auth_OpenID_SuccessResponse($this->endpoint,
- array('openid.return_to' => $this->return_to));
- $ret = $this->consumer->_checkNonce($this->response, $this->nonce);
- $this->assertEquals($ret->status, Auth_OpenID_FAILURE);
- $this->assertEquals($ret->identity_url, $this->consumer_id);
- $this->assertTrue(strpos($ret->message, 'Nonce missing from store') === 0);
- }
-
- function test_tamperedNonce()
- {
- $this->return_to = sprintf('http://rt.unittest/?nonce=HACKED-%s',
- $this->nonce);
- $this->response = new Auth_OpenID_SuccessResponse($this->endpoint,
- array('openid.return_to' => $this->return_to));
- $ret = $this->consumer->_checkNonce($this->response, $this->nonce);
- $this->assertEquals($ret->status, Auth_OpenID_FAILURE);
- $this->assertEquals($ret->identity_url, $this->consumer_id);
- $this->assertTrue(strpos($ret->message, 'Nonce mismatch') === 0);
- }
-
- function test_missingNonce()
- {
- // no nonce parameter on the return_to
- $this->response = new Auth_OpenID_SuccessResponse($this->endpoint,
- array('openid.return_to' => $this->return_to));
- $ret = $this->consumer->_checkNonce($this->response, $this->nonce);
- $this->assertEquals($ret->status, Auth_OpenID_FAILURE);
- $this->assertEquals($ret->identity_url, $this->consumer_id);
- $this->assertTrue(strpos($ret->message,
- 'Nonce missing from return_to') === 0);
- }
-}
-
-class Tests_Auth_OpenID_Consumer_TestCheckAuthTriggered extends _TestIdRes {
- var $consumer_class = '_CheckAuthDetectingConsumer';
-
- function _doIdRes($query)
- {
- return $this->consumer->_doIdRes($query, $this->endpoint);
- }
-
- function test_checkAuthTriggered()
- {
- $query = array('openid.return_to' => $this->return_to,
- 'openid.identity' => $this->server_id,
- 'openid.assoc_handle' =>'not_found');
-
- $result = $this->_doIdRes($query);
- $error = __getError();
-
- if ($error === null) {
- $this->fail('_checkAuth did not happen.');
- }
- }
-
- function test_checkAuthTriggeredWithAssoc()
- {
- // Store an association for this server that does not match
- // the handle that is in the query
- $issued = time();
- $lifetime = 1000;
- $assoc = new Auth_OpenID_Association(
- 'handle', 'secret', $issued, $lifetime, 'HMAC-SHA1');
- $this->store->storeAssociation($this->server_url, $assoc);
-
- $query = array(
- 'openid.return_to' => $this->return_to,
- 'openid.identity' => $this->server_id,
- 'openid.assoc_handle' =>'not_found');
-
- $result = $this->_doIdRes($query);
- $error = __getError();
-
- if ($error === null) {
- $this->fail('_checkAuth did not happen.');
- }
- }
-
- function test_expiredAssoc()
- {
- // Store an expired association for the server with the handle
- // that is in the query
- $issued = time() - 10;
- $lifetime = 0;
- $handle = 'handle';
- $assoc = new Auth_OpenID_Association(
- $handle, 'secret', $issued, $lifetime, 'HMAC-SHA1');
- $this->assertTrue($assoc->getExpiresIn() <= 0);
- $this->store->storeAssociation($this->server_url, $assoc);
-
- $query = array(
- 'openid.return_to' => $this->return_to,
- 'openid.identity' => $this->server_id,
- 'openid.assoc_handle' => $handle);
-
- $info = $this->_doIdRes($query);
- $this->assertEquals('failure', $info->status);
- $this->assertEquals($this->consumer_id, $info->identity_url);
-
- $this->assertTrue(strpos($info->message, 'expired') !== false);
- }
-
- function test_newerAssoc()
- {
- // Store an expired association for the server with the handle
- // that is in the query
- $lifetime = 1000;
-
- $good_issued = time() - 10;
- $good_handle = 'handle';
- $good_assoc = new Auth_OpenID_Association(
- $good_handle, 'secret', $good_issued, $lifetime, 'HMAC-SHA1');
- $this->store->storeAssociation($this->server_url, $good_assoc);
-
- $bad_issued = time() - 5;
- $bad_handle = 'handle2';
- $bad_assoc = new Auth_OpenID_Association(
- $bad_handle, 'secret', $bad_issued, $lifetime, 'HMAC-SHA1');
- $this->store->storeAssociation($this->server_url, $bad_assoc);
-
- $query = array(
- 'openid.return_to' => $this->return_to,
- 'openid.identity' => $this->server_id,
- 'openid.assoc_handle' => $good_handle);
-
- $good_assoc->addSignature(array('return_to', 'identity'), $query);
- $info = $this->_doIdRes($query);
- $this->assertEquals($info->status, 'success');
- $this->assertEquals($this->consumer_id, $info->identity_url);
- }
-}
-
-class _MockFetcher {
- function _MockFetcher($response = null)
- {
- // response is (code, url, body)
- $this->response = $response;
- $this->fetches = array();
- }
-
- function post($url, $body)
- {
- $this->fetches[] = array($url, $body, array());
- return $this->response;
- }
-
- function get($url)
- {
- $this->fetches[] = array($url, null, array());
- return $this->response;
- }
-}
-
-class Tests_Auth_OpenID_Complete extends _TestIdRes {
- function test_cancel()
- {
- $query = array('openid.mode' => 'cancel');
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_CANCEL);
- $this->assertTrue($r->identity_url == $this->endpoint->identity_url);
- }
-
- function test_error()
- {
- $msg = 'an error message';
- $query = array('openid.mode' =>'error',
- 'openid.error' => $msg);
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_FAILURE);
- $this->assertTrue($r->identity_url == $this->endpoint->identity_url);
- $this->assertEquals($r->message, $msg);
- }
-
- function test_noMode()
- {
- $query = array();
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_FAILURE);
- $this->assertTrue($r->identity_url == $this->endpoint->identity_url);
- }
-
- function test_idResMissingField()
- {
- $query = array('openid.mode' => 'id_res');
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_FAILURE);
- $this->assertEquals($r->identity_url, $this->consumer_id);
- }
-
- function test_idResURLMismatch()
- {
- $query = array('openid.mode' => 'id_res',
- 'openid.return_to' => 'return_to (just anything)',
- 'openid.identity' => 'something wrong (not this->consumer_id)',
- 'openid.assoc_handle' => 'does not matter');
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_FAILURE);
- $this->assertEquals($r->identity_url, $this->consumer_id);
- $this->assertTrue(strpos($r->message, 'delegate') !== false);
- }
-}
-
-class Tests_Auth_OpenID_CheckAuthResponse extends _TestIdRes {
- function _createAssoc()
- {
- $issued = time();
- $lifetime = 1000;
- $assoc = new Auth_OpenID_Association(
- 'handle', 'secret', $issued, $lifetime, 'HMAC-SHA1');
- $store =& $this->consumer->store;
- $store->storeAssociation($this->server_url, $assoc);
- $assoc2 = $store->getAssociation($this->server_url);
- $this->assertEquals($assoc, $assoc2);
- }
-
- function test_goodResponse()
- {
- // successful response to check_authentication
- $response = array('is_valid' => 'true');
- $r = $this->consumer->_processCheckAuthResponse($response, $this->server_url);
- $this->assertTrue($r);
- }
-
- function test_missingAnswer()
- {
- // check_authentication returns false when the server sends no
- // answer
- $response = array();
- $r = $this->consumer->_processCheckAuthResponse($response, $this->server_url);
- $this->assertFalse($r);
- }
-
- function test_badResponse()
- {
- // check_authentication returns false when is_valid is false
- $response = array('is_valid' => 'false');
- $r = $this->consumer->_processCheckAuthResponse($response, $this->server_url);
- $this->assertFalse($r);
- }
-
- function test_badResponseInvalidate()
- {
- // Make sure that the handle is invalidated when is_valid is
- // false
- $this->_createAssoc();
- $response = array('is_valid' => 'false',
- 'invalidate_handle' => 'handle');
-
- $r = $this->consumer->_processCheckAuthResponse($response,
- $this->server_url);
- $this->assertFalse($r);
- $this->assertTrue(
- $this->consumer->store->getAssociation($this->server_url) === null);
- }
-
- function test_invalidateMissing()
- {
- // invalidate_handle with a handle that is not present
- $response = array('is_valid' => 'true',
- 'invalidate_handle' => 'missing');
-
- $r = $this->consumer->_processCheckAuthResponse($response, $this->server_url);
- $this->assertTrue($r);
- }
-
- function test_invalidatePresent()
- {
- // invalidate_handle with a handle that exists"""
- $this->_createAssoc();
- $response = array('is_valid' => 'true',
- 'invalidate_handle' => 'handle');
-
- $r = $this->consumer->_processCheckAuthResponse($response, $this->server_url);
- $this->assertTrue($r);
- $this->assertTrue(
- $this->consumer->store->getAssociation($this->server_url) === null);
- }
-}
-
-class _IdResFetchFailingConsumer extends Auth_OpenID_GenericConsumer {
- var $message = 'fetch failed';
-
- function _doIdRes($query, $endpoint)
- {
- return new Auth_OpenID_FailureResponse($endpoint,
- $this->message);
- }
-}
-
-class Tests_Auth_OpenID_FetchErrorInIdRes extends _TestIdRes {
- var $consumer_class = '_IdResFetchFailingConsumer';
-
- function test_idResFailure()
- {
- $query = array('openid.mode' => 'id_res');
- $r = $this->consumer->complete($query, $this->endpoint);
- $this->assertEquals($r->status, Auth_OpenID_FAILURE);
- $this->assertEquals($r->identity_url, $this->consumer_id);
- $this->assertEquals($this->consumer->message, $r->message);
- }
-}
-
-class _ExceptionRaisingMockFetcher {
- function get($url)
- {
- __raiseError(E_MOCK_FETCHER_EXCEPTION);
- }
-
- function post($url, $body)
- {
- __raiseError(E_MOCK_FETCHER_EXCEPTION);
- }
-}
-
-class _BadArgCheckingConsumer extends Auth_OpenID_GenericConsumer {
- function _makeKVPost($args, $tmp)
- {
- if ($args != array(
- 'openid.mode' => 'check_authentication',
- 'openid.signed' => 'foo')) {
- __raiseError(E_ASSERTION_ERROR);
- }
- return null;
- }
-}
-
-class Tests_Auth_OpenID_Consumer_TestCheckAuth extends _TestIdRes {
- function setUp()
- {
- $this->store = new Tests_Auth_OpenID_MemStore();
- $this->consumer = new Auth_OpenID_GenericConsumer($this->store);
- $this->fetcher = new _MockFetcher();
- $this->consumer->fetcher =& $this->fetcher;
- }
-
- function test_checkauth_error()
- {
- global $_Auth_OpenID_server_url;
- $this->fetcher->response = new Services_Yadis_HTTPResponse("http://some_url",
- 404,
- array(),
- "blah:blah\n");
- $query = array('openid.signed' => 'stuff, things');
- $r = $this->consumer->_checkAuth($query, $_Auth_OpenID_server_url);
- if ($r !== false) {
- $this->fail("Expected _checkAuth result to be false");
- }
- }
-
- function test_bad_args()
- {
- $query = array('openid.signed' => 'foo',
- 'closid.foo' => 'something');
-
- $consumer = new _BadArgCheckingConsumer($this->store);
- $consumer->_checkAuth($query, 'does://not.matter');
- $this->assertEquals(__getError(), E_ASSERTION_ERROR);
- }
-}
-
-class Tests_Auth_OpenID_Consumer_TestFetchAssoc extends PHPUnit_TestCase {
- function setUp()
- {
- $this->store = new Tests_Auth_OpenID_MemStore();
- $this->fetcher = new _MockFetcher();
- $this->consumer = new Auth_OpenID_GenericConsumer($this->store);
- $this->consumer->fetcher =& $this->fetcher;
- }
-
- function test_kvpost_error()
- {
- $this->fetcher->response = new Services_Yadis_HTTPResponse("http://some_url",
- 404,
- array(),
- "blah:blah\n");
- $r = $this->consumer->_makeKVPost(array('openid.mode' => 'associate'),
- "http://server_url");
- if ($r !== null) {
- $this->fail("Expected _makeKVPost result to be null");
- }
- }
-
- function test_error_exception()
- {
- $this->consumer->fetcher = new _ExceptionRaisingMockFetcher();
-
- $this->consumer->_makeKVPost(array('openid.mode' => 'associate'),
- "http://server_url");
-
- if (__getError() !== E_MOCK_FETCHER_EXCEPTION) {
- $this->fail("Expected ExceptionRaisingMockFetcher to " .
- "raise E_MOCK_FETCHER_EXCEPTION");
- }
-
- // exception fetching returns no association
- $this->assertEquals(@$this->consumer->_getAssociation('some://url'), null);
-
- $this->consumer->_checkAuth(array('openid.signed' => ''),
- 'some://url');
-
- if (__getError() !== E_MOCK_FETCHER_EXCEPTION) {
- $this->fail("Expected ExceptionRaisingMockFetcher to " .
- "raise E_MOCK_FETCHER_EXCEPTION (_checkAuth)");
- }
- }
-}
-
-class Tests_Auth_OpenID_AuthRequest extends PHPUnit_TestCase {
- function setUp()
- {
- $this->endpoint = new Auth_OpenID_ServiceEndpoint();
- $this->endpoint->delegate = 'http://server.unittest/joe';
- $this->endpoint->server_url = 'http://server.unittest/';
- $this->assoc =& $this;
- $this->assoc->handle = 'assoc@handle';
- $this->authreq = new Auth_OpenID_AuthRequest($this->endpoint, $this->assoc);
- }
-
- function test_addExtensionArg()
- {
- $this->authreq->addExtensionArg('bag', 'color', 'brown');
- $this->authreq->addExtensionArg('bag', 'material', 'paper');
- $this->assertEquals($this->authreq->extra_args,
- array('openid.bag.color' => 'brown',
- 'openid.bag.material' => 'paper'));
- $url = $this->authreq->redirectURL('http://7.utest/', 'http://7.utest/r');
- $this->failUnless(strpos($url, 'openid.bag.color=brown') !== false,
- 'extension arg not found in '.$url);
- $this->failUnless(strpos($url, 'openid.bag.material=paper') !== false,
- 'extension arg not found in '.$url);
- }
-}
-
-class Tests_Auth_OpenID_SuccessResponse extends PHPUnit_TestCase {
- function setUp()
- {
- $this->endpoint = new Auth_OpenID_ServiceEndpoint();
- $this->endpoint->identity_url = 'identity_url';
- }
-
- function test_extensionResponse()
- {
- $resp = SuccessResponse($this->endpoint, array(
- 'openid.unittest.one' => '1',
- 'openid.unittest.two' =>'2',
- 'openid.sreg.nickname' => 'j3h',
- 'openid.return_to' => 'return_to'));
-
- $utargs = $resp->extensionResponse('unittest');
- $this->assertEquals($utargs, array('one' => '1', 'two' => '2'));
- $sregargs = $resp->extensionResponse('sreg');
- $this->assertEquals($sregargs, array('nickname' => 'j3h'));
- }
-
- function test_noReturnTo()
- {
- $resp = SuccessResponse($this->endpoint, array());
- $this->failUnless($resp->getReturnTo() === null);
- }
-
- function test_returnTo()
- {
- $resp = SuccessResponse($this->endpoint,
- array('openid.return_to' => 'return_to'));
- $this->assertEquals($resp->getReturnTo(), 'return_to');
- }
-}
-
-class Tests_Auth_OpenID_ParseAssociation extends _TestIdRes {
- var $secret = '';
-
- function setUp()
- {
- parent::setUp();
- $this->secret = str_repeat('x', 20);
- }
-
- function test_missing()
- {
- // Missing required arguments
- $result = $this->consumer->_parseAssociation(array(), null, 'server_url');
- $this->assertTrue($result === null);
- }
-
- function _setUpDH()
- {
- list($sess, $args) = $this->consumer->_createAssociateRequest($this->server_url);
- $server_sess = Auth_OpenID_DiffieHellmanServerSession::fromQuery($args);
- $server_resp = $server_sess->answer($this->secret);
- $server_resp['assoc_type'] = 'HMAC-SHA1';
- $server_resp['assoc_handle'] = 'handle';
- $server_resp['expires_in'] = '1000';
- $server_resp['session_type'] = 'DH-SHA1';
- return array($sess, $server_resp);
- }
-
- function test_success()
- {
- list($sess, $server_resp) = $this->_setUpDH();
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret !== null);
- $this->assertEquals($ret->assoc_type, 'HMAC-SHA1');
- $this->assertEquals($ret->secret, $this->secret);
- $this->assertEquals($ret->handle, 'handle');
- $this->assertEquals($ret->lifetime, 1000);
- }
-
- function test_badAssocType()
- {
- list($sess, $server_resp) = $this->_setUpDH();
- $server_resp['assoc_type'] = 'Crazy Low Prices!!!';
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret === null);
- }
-
- function test_badExpiresIn()
- {
- list($sess, $server_resp) = $this->_setUpDH();
- $server_resp['expires_in'] = 'Crazy Low Prices!!!';
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret === null);
- }
-
- function test_badSessionType()
- {
- list($sess, $server_resp) = $this->_setUpDH();
- $server_resp['session_type'] = '|/iA6rA';
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret === null);
- }
-
- function test_plainFallback()
- {
- $sess = new Auth_OpenID_DiffieHellmanConsumerSession();
- $server_resp = array(
- 'assoc_type' => 'HMAC-SHA1',
- 'assoc_handle' => 'handle',
- 'expires_in' => '1000',
- 'mac_key' => base64_encode($this->secret));
-
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret !== null);
- $this->assertEquals($ret->assoc_type, 'HMAC-SHA1');
- $this->assertEquals($ret->secret, $this->secret);
- $this->assertEquals($ret->handle, 'handle');
- $this->assertEquals($ret->lifetime, 1000);
- }
-
- function test_plainFallbackFailure()
- {
- $sess = new Auth_OpenID_DiffieHellmanConsumerSession();
- // missing mac_key
- $server_resp = array(
- 'assoc_type' => 'HMAC-SHA1',
- 'assoc_handle' => 'handle',
- 'expires_in' => '1000');
-
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret === null);
- }
-
- function test_badDHValues()
- {
- list($sess, $server_resp) = $this->_setUpDH();
- $server_resp['enc_mac_key'] = "\x00\x00\x00";
- $ret = $this->consumer->_parseAssociation($server_resp, $sess,
- 'server_url');
- $this->assertTrue($ret === null);
- }
-}
-
-class _StubConsumer {
- function _StubConsumer()
- {
- $this->assoc = null;
- $this->response = null;
- $this->endpoint = null;
- $this->fetcher = new _MockFetcher();
- }
-
- function begin($service)
- {
- $auth_req = new Auth_OpenID_AuthRequest($this->assoc, $service);
- $this->endpoint = $service;
- return $auth_req;
- }
-
- function complete($query, $endpoint)
- {
- return $this->response;
- }
-}
-
-class Tests_Auth_OpenID_ConsumerTest2 extends PHPUnit_TestCase {
- function setUp()
- {
- foreach ($_SESSION as $k => $v) {
- unset($_SESSION[$k]);
- }
-
- $this->endpoint = new Auth_OpenID_ServiceEndpoint();
- $this->identity_url = 'http://identity.url/';
- $this->endpoint->identity_url = $this->identity_url;
- $this->store = null;
- $this->session = new Services_Yadis_PHPSession();
- $this->consumer =& new Auth_OpenID_Consumer($this->store, &$this->session);
- $this->consumer->consumer =& new _StubConsumer();
- $this->discovery =& new Services_Yadis_Discovery(&$this->session,
- $this->identity_url,
- $this->consumer->session_key_prefix);
- }
-
- function test_beginWithoutDiscovery()
- {
- // Does this really test anything non-trivial?
- $result = $this->consumer->beginWithoutDiscovery($this->endpoint);
-
- // The result is an auth request
- $this->assertTrue(strtolower(get_class($result)) ==
- 'auth_openid_authrequest');
-
- $loader = new Auth_OpenID_ServiceEndpointLoader();
-
- // Side-effect of calling beginWithoutDiscovery is setting the
- // session value to the endpoint attribute of the result
- $this->assertTrue(
- $loader->fromSession(
- $this->session->get($this->consumer->_token_key)) ==
- $result->endpoint);
-
- // The endpoint that we passed in is the endpoint on the
- // auth_request
- $this->assertTrue($result->endpoint == $this->endpoint);
- }
-
- function test_completeEmptySession()
- {
- $response = $this->consumer->complete(array());
- $this->assertEquals($response->status, Auth_OpenID_FAILURE);
- $this->assertTrue($response->identity_url === null);
- }
-
- function _doResp($auth_req, $exp_resp)
- {
- // complete a transaction, using the expected response from
- // the generic consumer.
- $this->consumer->consumer->response = $exp_resp;
-
- // endpoint is stored in the session
- // $this->assertTrue($this->session->data);
- $this->assertTrue($_SESSION);
- $resp = $this->consumer->complete(array());
-
- // All responses should have the same identity URL, and the
- // session should be cleaned out
- $this->assertTrue($resp->identity_url == $this->identity_url);
- $this->assertFalse(in_array($this->consumer->_token_key,
- $_SESSION)); // this->session->data));
-
- // Expected status response
- $this->assertEquals($resp->status, $exp_resp->status);
-
- return $resp;
- }
-
- function _doRespNoDisco($exp_resp)
- {
- // Set up a transaction without discovery
- $auth_req = $this->consumer->beginWithoutDiscovery($this->endpoint);
- $resp = $this->_doResp($auth_req, $exp_resp);
- // There should be nothing left in the session once we have
- // completed.
- $this->assertFalse($this->session->contents());
- return $resp;
- }
-
- function test_noDiscoCompleteSuccessWithToken()
- {
- $this->_doRespNoDisco(new Auth_OpenID_SuccessResponse($this->endpoint,
- array()));
- }
-
- function test_noDiscoCompleteCancelWithToken()
- {
- $this->_doRespNoDisco(new Auth_OpenID_CancelResponse($this->endpoint));
- }
-
- function test_noDiscoCompleteFailure()
- {
- $msg = 'failed!';
- $resp = $this->_doRespNoDisco(new Auth_OpenID_FailureResponse($this->endpoint, $msg));
- $this->assertTrue($resp->message == $msg);
- }
-
- function test_noDiscoCompleteSetupNeeded()
- {
- $setup_url = 'http://setup.url/';
- $resp = $this->_doRespNoDisco(
- new Auth_OpenID_SetupNeededResponse($this->endpoint, $setup_url));
- $this->assertTrue($resp->setup_url == $setup_url);
- }
-
- // To test that discovery is cleaned up, we need to initialize a
- // Yadis manager, and have it put its values in the session.
- function _doRespDisco($is_clean, $exp_resp)
- {
- // Set up and execute a transaction, with discovery
- $this->discovery->createManager(array($this->endpoint),
- $this->identity_url);
- $auth_req = $this->consumer->begin($this->identity_url);
- $resp = $this->_doResp($auth_req, $exp_resp);
-
- $manager = $this->discovery->getManager();
- if ($is_clean) {
- $this->assertTrue($this->discovery->getManager() === null);
- } else {
- $this->assertFalse($this->discovery->getManager() === null);
- }
-
- return $resp;
- }
-
- // Cancel and success DO clean up the discovery process
- function test_completeSuccess()
- {
- $this->_doRespDisco(true,
- new Auth_OpenID_SuccessResponse($this->endpoint,
- array()));
- }
-
- function test_completeCancel()
- {
- $this->_doRespDisco(true,
- new Auth_OpenID_CancelResponse($this->endpoint));
- }
-
- // Failure and setup_needed don't clean up the discovery process
- function test_completeFailure()
- {
- $msg = 'failed!';
- $resp = $this->_doRespDisco(false,
- new Auth_OpenID_FailureResponse($this->endpoint, $msg));
- $this->assertTrue($resp->message == $msg);
- }
-
- function test_completeSetupNeeded()
- {
- $setup_url = 'http://setup.url/';
- $resp = $this->_doRespDisco(false,
- new Auth_OpenID_SetupNeededResponse($this->endpoint, $setup_url));
- $this->assertTrue($resp->status == Auth_OpenID_SETUP_NEEDED);
- $this->assertTrue($resp->setup_url == $setup_url);
- }
-
- function test_begin()
- {
- $this->discovery->createManager(array($this->endpoint),
- $this->identity_url);
- // Should not raise an exception
- $auth_req = $this->consumer->begin($this->identity_url);
- $this->assertTrue(strtolower(get_class($auth_req)) === 'auth_openid_authrequest');
- $this->assertTrue($auth_req->endpoint == $this->endpoint);
- $this->assertTrue($auth_req->endpoint == $this->consumer->consumer->endpoint);
- $this->assertTrue($auth_req->assoc == $this->consumer->consumer->assoc);
- }
-}
-
-// Add other test cases to be run.
-$Tests_Auth_OpenID_Consumer_other = array(
- new Tests_Auth_OpenID_Consumer_TestSetupNeeded(),
- new Tests_Auth_OpenID_Consumer_TestCheckAuth(),
- new Tests_Auth_OpenID_Consumer_TestCheckAuthTriggered(),
- new Tests_Auth_OpenID_Consumer_TestFetchAssoc(),
- new Tests_Auth_OpenID_Consumer_CheckNonceTest(),
- new Tests_Auth_OpenID_Complete(),
- new Tests_Auth_OpenID_CheckAuthResponse(),
- new Tests_Auth_OpenID_FetchErrorInIdRes(),
- new Tests_Auth_OpenID_ParseAssociation(),
- new Tests_Auth_OpenID_ConsumerTest2()
- );
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/CryptUtil.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/CryptUtil.php
deleted file mode 100644
index 497002385..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/CryptUtil.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/CryptUtil.php';
-
-class Tests_Auth_OpenID_CryptUtil extends PHPUnit_TestCase {
- function test_length()
- {
- $cases = array(1, 10, 255);
- foreach ($cases as $length) {
- $data = Auth_OpenID_CryptUtil::getBytes($length);
- $this->assertEquals(strlen($data), $length);
- }
- }
-
- function test_different()
- {
- $num_iterations = 100;
- $data_length = 20;
-
- $data = Auth_OpenID_CryptUtil::getBytes($num_iterations);
- for ($i = 0; $i < $num_iterations; $i++) {
- $last = $data;
- $data = Auth_OpenID_CryptUtil::getBytes($data_length);
- $this->assertFalse($data == $last);
- }
- }
-
- function test_cryptrand()
- {
- // It's possible, but HIGHLY unlikely that a correct
- // implementation will fail by returning the same number twice
-
- $s = Auth_OpenID_CryptUtil::getBytes(32);
- $t = Auth_OpenID_CryptUtil::getBytes(32);
- $this->assertEquals(strlen($s), 32);
- $this->assertEquals(strlen($t), 32);
- $this->assertFalse($s == $t);
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/DiffieHellman.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/DiffieHellman.php
deleted file mode 100644
index 011857c89..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/DiffieHellman.php
+++ /dev/null
@@ -1,160 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/DiffieHellman.php';
-require_once 'Tests/Auth/OpenID/TestUtil.php';
-
-class Tests_Auth_OpenID_DiffieHellman_CheckCases extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_DiffieHellman_CheckCases($cases, $n)
- {
- $this->cases = $cases;
- $this->n = $n;
- }
-
- function runTest()
- {
- $this->assertEquals($this->n, count($this->cases));
- }
-}
-
-class Tests_Auth_OpenID_DiffieHellman_Private extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_DiffieHellman_Private($name, $input, $expected)
- {
- $this->setName("$name");
- $this->input = $input;
- $this->expected = $expected;
- }
-
- function runTest()
- {
- $lib =& Auth_OpenID_getMathLib();
- $dh = new Auth_OpenID_DiffieHellman(null, null, $this->input);
- $this->assertEquals($lib->cmp($this->expected, $dh->getPublicKey()), 0);
- }
-}
-
-class Tests_Auth_OpenID_DiffieHellman_Exch extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_DiffieHellman_Exch($name, $p1, $p2, $shared)
- {
- $this->setName("$name");
- $this->p1 = $p1;
- $this->p2 = $p2;
- $this->shared = $shared;
- }
-
- function runTest()
- {
- $lib =& Auth_OpenID_getMathLib();
- $shared = $lib->init($this->shared);
- $dh1 = new Auth_OpenID_DiffieHellman(null, null, $this->p1);
- $dh2 = new Auth_OpenID_DiffieHellman(null, null, $this->p2);
- $sh1 = $dh1->getSharedSecret($dh2->getPublicKey());
- $sh2 = $dh2->getSharedSecret($dh1->getPublicKey());
- $this->assertEquals($lib->cmp($shared, $sh1), 0);
- $this->assertEquals($lib->cmp($shared, $sh2), 0);
- }
-}
-
-class Tests_Auth_OpenID_DiffieHellman extends PHPUnit_TestSuite {
- function _readPrivateTestCases()
- {
- $lines = Tests_Auth_OpenID_readlines('dhpriv');
- $cases = array();
- foreach ($lines as $line) {
- $case = array();
- if (!preg_match('/^(\d+) (\d+)\n$/', $line, $case)) {
- trigger_error("Bad test input: $line", E_USER_ERROR);
- }
-
- $c = count($case);
- if ($c != 3) {
- trigger_error("Wrong number of elements in parsed case: $c",
- E_USER_ERROR);
- }
-
- array_shift($case);
- $cases[] = $case;
- }
-
- return $cases;
- }
-
- function _readExchTestCases()
- {
- $lines = Tests_Auth_OpenID_readlines('dhexch');
- $cases = array();
- foreach ($lines as $line) {
- $case = array();
- if (!preg_match('/^(\d+) (\d+) (\d+)\n$/', $line, $case)) {
- trigger_error("Bad test input: $line", E_USER_ERROR);
- }
-
- $c = count($case);
- if ($c != 4) {
- trigger_error("Wrong number of elements in parsed case: $c",
- E_USER_ERROR);
- }
-
- array_shift($case);
- $cases[] = $case;
- }
- return $cases;
- }
-
- function Tests_Auth_OpenID_DiffieHellman($name)
- {
- $this->setName($name);
-
- $priv_cases = Tests_Auth_OpenID_DiffieHellman::_readPrivateTestCases();
- $sanity = new Tests_Auth_OpenID_DiffieHellman_CheckCases(
- $priv_cases, 29);
- $sanity->setName('Check parsing of priv test data');
- $this->addTest($sanity);
-
- $exch_cases = Tests_Auth_OpenID_DiffieHellman::_readExchTestCases();
- $sanity = new Tests_Auth_OpenID_DiffieHellman_CheckCases(
- $exch_cases, 25);
- $sanity->setName('Check parsing of exch test data');
- $this->addTest($sanity);
-
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- if (defined('Tests_Auth_OpenID_thorough')) {
- $npriv = count($priv_cases);
- $nexch = count($exch_cases);
- } else {
- $npriv = 1;
- $nexch = 3;
- }
-
- for ($i = 0; $i < $npriv; $i++) {
- list($input, $expected) = $priv_cases[$i];
- $one = new Tests_Auth_OpenID_DiffieHellman_Private(
- "DHPriv $i", $input, $expected);
- $this->addTest($one);
- }
-
- for ($i = 0; $i < $nexch; $i++) {
- $case = $exch_cases[$i];
- $one = new Tests_Auth_OpenID_DiffieHellman_Exch(
- $i, $case[0], $case[1], $case[2]);
- $this->addTest($one);
- }
- }
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Discover.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Discover.php
deleted file mode 100644
index b01835c9b..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Discover.php
+++ /dev/null
@@ -1,670 +0,0 @@
-responses = $responses;
- }
-
- function get($url)
- {
- $response = array_pop($this->responses);
- assert($response[1] == $url);
- return $response;
- }
-}
-
-class Tests_Services_Yadis_DiscoveryFailure extends PHPUnit_TestCase {
-
- function Tests_Services_Yadis_DiscoveryFailure($responses)
- {
- // Response is ($code, $url, $body).
- $this->cases = array(
- array(null, 'http://network.error/', ''),
- array(404, 'http://not.found/', ''),
- array(400, 'http://bad.request/', ''),
- array(500, 'http://server.error/', ''),
- array(200, 'http://header.found/', 200,
- array('x-xrds-location' => 'http://xrds.missing/')),
- array(404, 'http://xrds.missing/', ''));
-
- $this->url = $responses[0]->final_url;
- $this->responses = $responses;
- $this->fetcher = new _SimpleMockFetcher($this->responses);
- }
-
- function runTest()
- {
- foreach ($this->cases as $case) {
- list($status, $url, $body) = $case;
- $expected_status = $status;
-
- $result = Auth_OpenID_discover($this->url, $this->fetcher);
- list($id_url, $svclist, $http_response) = $result;
-
- $this->assertEquals($http_response->status, $expected_status);
- }
- }
-}
-
-### Tests for raising/catching exceptions from the fetcher through the
-### discover function
-
-class _ErrorRaisingFetcher {
- // Just raise an exception when fetch is called
-
- function _ErrorRaisingFetcher($thing_to_raise)
- {
- $this->thing_to_raise = $thing_to_raise;
- }
-
- function post($body = null)
- {
- __raiseError($this->thing_to_raise);
- }
-
- function get($url)
- {
- __raiseError($this->thing_to_raise);
- }
-}
-
-define('E_AUTH_OPENID_EXCEPTION', 'e_exception');
-define('E_AUTH_OPENID_DIDFETCH', 'e_didfetch');
-define('E_AUTH_OPENID_VALUE_ERROR', 'e_valueerror');
-define('E_AUTH_OPENID_RUNTIME_ERROR', 'e_runtimeerror');
-define('E_AUTH_OPENID_OI', 'e_oi');
-
-class Tests_Auth_OpenID_Discover_FetchException extends PHPUnit_TestCase {
- // Make sure exceptions get passed through discover function from
- // fetcher.
-
- function Tests_Auth_OpenID_Discover_FetchException($exc)
- {
- $this->cases = array(E_AUTH_OPENID_EXCEPTION,
- E_AUTH_OPENID_DIDFETCH,
- E_AUTH_OPENID_VALUE_ERROR,
- E_AUTH_OPENID_RUNTIME_ERROR,
- E_AUTH_OPENID_OI);
- }
-
- function runTest()
- {
- foreach ($this->cases as $thing_to_raise) {
- $fetcher = ErrorRaisingFetcher($thing_to_raise);
- Auth_OpenID_discover('http://doesnt.matter/', $fetcher);
- $exc = __getError();
-
- if ($exc !== $thing_to_raise) {
- $this->fail('FetchException expected %s to be raised',
- $thing_to_raise);
- }
- }
- }
-}
-
-
-// Tests for openid.consumer.discover.discover
-
-class _DiscoveryMockFetcher {
- function _DiscoveryMockFetcher(&$documents)
- {
- $this->redirect = null;
- $this->documents = &$documents;
- $this->fetchlog = array();
- }
-
- function post($url, $body = null, $headers = null)
- {
- return $this->get($url, $headers, $body);
- }
-
- function get($url, $headers = null, $body = null)
- {
- $this->fetchlog[] = array($url, $body, $headers);
-
- if ($this->redirect) {
- $final_url = $this->redirect;
- } else {
- $final_url = $url;
- }
-
- if (array_key_exists($url, $this->documents)) {
- list($ctype, $body) = $this->documents[$url];
- $status = 200;
- } else {
- $status = 404;
- $ctype = 'text/plain';
- $body = '';
- }
-
- return new Services_Yadis_HTTPResponse($final_url, $status,
- array('content-type' => $ctype), $body);
- }
-}
-
-define('DISCOVERYBASE_ID_URL', "http://someuser.unittest/");
-
-class _DiscoveryBase extends PHPUnit_TestCase {
- var $id_url = DISCOVERYBASE_ID_URL;
- var $documents = array();
-
- function setUp()
- {
- $this->fetcher = new _DiscoveryMockFetcher($this->documents);
- }
-}
-
-$__yadis_2entries = '
-
-
- =!1000
-
-
- http://openid.net/signon/1.0
- http://www.myopenid.com/server
- http://smoker.myopenid.com/
-
-
-
- http://openid.net/signon/1.0
- http://www.livejournal.com/openid/server.bml
- http://frank.livejournal.com/
-
-
-
-
-';
-
-$__yadis_2entries_flipped_priority = '
-
-
-
-
- http://openid.net/signon/1.0
- http://www.myopenid.com/server
- http://smoker.myopenid.com/
-
-
-
- http://openid.net/signon/1.0
- http://www.livejournal.com/openid/server.bml
- http://frank.livejournal.com/
-
-
-
-
-';
-
-$__yadis_another = '
-
-
-
-
- http://openid.net/signon/1.0
- http://vroom.unittest/server
- http://smoker.myopenid.com/
-
-
-
-';
-
-$__yadis_0entries = '
-
-
-
- http://is-not-openid.unittest/
- http://noffing.unittest./
-
-
-
-';
-
-$__yadis_no_delegate = '
-
-
-
- http://openid.net/signon/1.0
- http://www.myopenid.com/server
-
-
-
-';
-
-$__openid_html = '
-
-
-
- Identity Page for Smoker
-
-
- foo
-';
-
-$__openid_html_no_delegate = '
-
-
-
- Identity Page for Smoker
-
- foo
-';
-
-$__openid_and_yadis_html = '
-
-
-
- Identity Page for Smoker
-
-
-
- foo
-';
-
-class _MockFetcherForXRIProxy {
-
- function _MockFetcherForXRIProxy($documents)
- {
- $this->documents = $documents;
- $this->fetchlog = array();
- }
-
- function get($url, $headers=null)
- {
- return $this->fetch($url, $headers);
- }
-
- function post($url, $body)
- {
- return $this->fetch($url, $body);
- }
-
- function fetch($url, $body=null, $headers=null)
- {
- $this->fetchlog[] = array($url, $body, $headers);
-
- $u = parse_url($url);
- $proxy_host = $u['host'];
- $xri = $u['path'];
- $query = $u['query'];
-
- if ((!$headers) && (!$query)) {
- trigger_error('Error in mock XRI fetcher: no headers or query');
- }
-
- if (Services_Yadis_startswith($xri, '/')) {
- $xri = substr($xri, 1);
- }
-
- if (array_key_exists($xri, $this->documents)) {
- list($ctype, $body) = $this->documents[$xri];
- $status = 200;
- } else {
- $status = 404;
- $ctype = 'text/plain';
- $body = '';
- }
-
- return new Services_Yadis_HTTPResponse($url, $status,
- array('content-type' => $ctype),
- $body);
- }
-}
-
-class Tests_Auth_OpenID_DiscoverSession {
- function Tests_Auth_OpenID_DiscoverSession()
- {
- $this->data = array();
- }
-
- function set($name, $value)
- {
- $this->data[$name] = $value;
- }
-
- function get($name, $default=null)
- {
- if (array_key_exists($name, $this->data)) {
- return $this->data[$name];
- } else {
- return $default;
- }
- }
-
- function del($name)
- {
- unset($this->data[$name]);
- }
-}
-
-$__Tests_BOGUS_SERVICE = new Auth_OpenID_ServiceEndpoint();
-$__Tests_BOGUS_SERVICE->identity_url = "=really.bogus.endpoint";
-
-function __serviceCheck_discover_cb($url, $fetcher)
-{
- global $__Tests_BOGUS_SERVICE;
- return array($__Tests_BOGUS_SERVICE);
-}
-
-class Tests_Auth_OpenID_Discover extends _DiscoveryBase {
- function _usedYadis($service)
- {
- $this->assertTrue($service->used_yadis,
- "Expected to use Yadis");
- }
-
- function _notUsedYadis($service)
- {
- $this->assertFalse($service->used_yadis,
- "Expected to use old-style discovery");
- }
-
- function test_404()
- {
- $result = Auth_OpenID_discover($this->id_url . '/404',
- $this->fetcher);
-
- list($id_url, $svclist, $http_response) = $result;
-
- $this->assertTrue($http_response->status == 404,
- "Expected 404 status from /404 discovery");
- }
-
- function test_noYadis()
- {
- global $__openid_html;
-
- $this->documents[$this->id_url] = array('text/html', $__openid_html);
-
- list($id_url, $services, $http_response) =
- Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertEquals(count($services), 1,
- "More than one service");
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->assertEquals($services[0]->delegate,
- "http://smoker.myopenid.com/");
-
- $this->assertEquals($services[0]->identity_url, $this->id_url);
- $this->_notUsedYadis($services[0]);
- }
-
- function test_managerServices()
- {
- global $__yadis_2entries_flipped_priority;
-
- $url = "http://bogus.xxx/";
- $sess = new Tests_Auth_OpenID_DiscoverSession();
- $m = new Services_Yadis_Discovery($sess, $url);
-
- $documents = array(
- $url => array("application/xrds+xml",
- $__yadis_2entries_flipped_priority)
- );
-
- $fetcher = new _DiscoveryMockFetcher($documents);
-
- $expected = array("http://frank.livejournal.com/",
- "http://smoker.myopenid.com/");
-
- foreach ($expected as $openid) {
- $s = $m->getNextService('_Auth_OpenID_discoverServiceList',
- $fetcher);
- $this->assertEquals($s->delegate, $openid);
- }
- }
-
- function test_serviceCheck()
- {
- global $__Tests_BOGUS_SERVICE;
-
- $url = "http://bogus.xxx/";
- $sess =& new Tests_Auth_OpenID_DiscoverSession();
- $disco =& new Services_Yadis_Discovery($sess, $url);
-
- # Set an empty manager to be sure it gets blown away
- $manager =& new Services_Yadis_Manager($url, null, array(),
- $disco->getSessionKey());
-
- $loader =& new Services_Yadis_ManagerLoader();
- $disco->session->set($disco->session_key,
- serialize($loader->toSession($manager)));
-
- $docs = array();
- $fetcher =& new _DiscoveryMockFetcher($docs);
-
- $result = $disco->getNextService('__serviceCheck_discover_cb', $fetcher);
-
- $newMan = $disco->getManager();
-
- $currentService = $newMan->_current;
- $this->assertEquals($currentService->identity_url,
- $__Tests_BOGUS_SERVICE->identity_url);
- }
-
- function test_noOpenID()
- {
- $this->fetcher->documents = array(
- $this->id_url => array('text/plain', "junk"));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertFalse(count($services) > 0);
- }
-
- function test_yadis()
- {
- global $__yadis_2entries;
-
- $this->fetcher->documents = array(
- DISCOVERYBASE_ID_URL => array('application/xrds+xml',
- $__yadis_2entries));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertEquals(count($services), 2,
- "Not 2 services");
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->_usedYadis($services[0]);
-
- $this->assertEquals($services[1]->server_url,
- "http://www.livejournal.com/openid/server.bml");
-
- $this->_usedYadis($services[1]);
- }
-
- function test_redirect()
- {
- global $__openid_html;
-
- $expected_final_url = "http://elsewhere.unittest/";
-
- $this->fetcher->redirect = $expected_final_url;
- $this->fetcher->documents = array(
- $this->id_url => array('text/html', $__openid_html));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($expected_final_url, $id_url);
-
- $this->assertEquals(count($services), 1,
- "More than one service");
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->assertEquals($services[0]->delegate,
- "http://smoker.myopenid.com/");
-
- $this->assertEquals($services[0]->identity_url,
- $expected_final_url);
-
- $this->_notUsedYadis($services[0]);
- }
-
- function test_emptyList()
- {
- global $__yadis_0entries;
-
- $this->fetcher->documents = array(
- $this->id_url =>
- array('application/xrds+xml', $__yadis_0entries));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertTrue(count($services) == 0);
- }
-
- function test_emptyListWithLegacy()
- {
- global $__openid_and_yadis_html,
- $__yadis_0entries;
-
- $this->fetcher->documents = array(
- $this->id_url => array('text/html', $__openid_and_yadis_html),
- $this->id_url . 'xrds' => array('application/xrds+xml', $__yadis_0entries));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertEquals(count($services), 1,
- "Not one service");
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->assertEquals($services[0]->identity_url, $this->id_url);
-
- $this->_notUsedYadis($services[0]);
- }
-
- function test_yadisNoDelegate()
- {
- global $__yadis_no_delegate;
-
- $this->fetcher->documents = array(
- $this->id_url => array('application/xrds+xml', $__yadis_no_delegate));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertEquals(count($services), 1,
- "Not 1 service");
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->assertEquals($services[0]->delegate, null,
- 'Delegate should be null');
-
- $this->_usedYadis($services[0]);
- }
-
- function test_openidNoDelegate()
- {
- global $__openid_html_no_delegate;
-
- $this->fetcher->documents = array(
- $this->id_url => array('text/html',
- $__openid_html_no_delegate));
-
- list($id_url, $services, $http) = Auth_OpenID_discover($this->id_url,
- $this->fetcher);
-
- $this->assertEquals($this->id_url, $id_url);
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
-
- $this->assertEquals($services[0]->identity_url, $this->id_url);
-
- $this->assertEquals($services[0]->delegate, null,
- 'Delegate should be null');
-
- $this->_notUsedYadis($services[0]);
- }
-
- function test_xriDiscovery()
- {
- global $__yadis_2entries;
-
- $documents = array(
- '=smoker' => array('application/xrds+xml',
- $__yadis_2entries)
- );
-
- $fetcher = new _MockFetcherForXRIProxy($documents);
-
- list($user_xri, $services) = _Auth_OpenID_discoverXRI('=smoker',
- $fetcher);
- $this->assertTrue($services);
-
- $this->assertEquals($services[0]->server_url,
- "http://www.myopenid.com/server");
- $this->assertEquals($services[1]->server_url,
- "http://www.livejournal.com/openid/server.bml");
- $this->assertEquals($services[0]->canonicalID, Services_Yadis_XRI("=!1000"));
- }
-
- function test_useCanonicalID()
- {
- // When there is no delegate, the CanonicalID should be used
- // with XRI.
-
- $endpoint = new Auth_OpenID_ServiceEndpoint();
- $endpoint->identity_url = "=example";
- $endpoint->canonicalID = Services_Yadis_XRI("=!1000");
- $this->assertEquals($endpoint->getServerID(), Services_Yadis_XRI("=!1000"));
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/HMACSHA1.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/HMACSHA1.php
deleted file mode 100644
index 07fd4cba7..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/HMACSHA1.php
+++ /dev/null
@@ -1,148 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/HMACSHA1.php';
-require_once 'Tests/Auth/OpenID/TestUtil.php';
-
-class Tests_Auth_OpenID_HMACSHA1_TestCase extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_HMACSHA1_TestCase(
- $name, $key, $data, $expected)
- {
-
- $this->setName($name);
- $this->key = $key;
- $this->data = $data;
- $this->expected = $expected;
- }
-
- function runTest()
- {
- $actual = Auth_OpenID_HMACSHA1($this->key, $this->data);
- $this->assertEquals($this->expected, $actual);
- }
-}
-
-class Tests_Auth_OpenID_HMACSHA1 extends PHPUnit_TestSuite {
- function _strConvert($s)
- {
- $repeat_pat = '/^0x([a-f0-9]{2}) repeated (\d+) times$/';
- if (preg_match($repeat_pat, $s, $match)) {
- $c = chr(hexdec($match[1]));
- $n = $match[2];
- $data = '';
- for ($i = 0; $i < $n; $i++) {
- $data .= $c;
- }
- } elseif (substr($s, 0, 2) == "0x") {
- $data = pack('H*', substr($s, 2, strlen($s) - 1));
- } elseif (preg_match('/^"(.*)"$/', $s, $match)) {
- $data = $match[1];
- } else {
- trigger_error("Bad data format: $s", E_USER_ERROR);
- }
- return $data;
- }
-
- function _readTestCases()
- {
- $lines = Tests_Auth_OpenID_readlines('hmac.txt');
- $cases = array();
- $case = array();
- foreach ($lines as $line) {
- if ($line{0} == "#") {
- continue;
- }
-
- // Blank line separates test cases
- if ($line == "\n") {
- $cases[] = $case;
- $case = array();
- } else {
- $match = array();
- $pat = '/^([a-z0-9_-]+) =\s+(.*?)\n$/';
- if (!preg_match($pat, $line, $match)) {
- trigger_error("Bad test input: $line", E_USER_ERROR);
- }
-
- $c = count($match);
- if ($c != 3) {
- trigger_error(
- "Wrong number of elements in parsed case: $c",
- E_USER_ERROR);
- return false;
- }
-
- $key = $match[1];
- $value = $match[2];
- $case[$key] = $value;
- }
- }
-
- if (count($case)) {
- $cases[] = $case;
- }
-
- $final = array();
-
- // Normalize strings and check data integrity
- foreach ($cases as $case) {
- $clean = array();
- $clean["key"] =
- Tests_Auth_OpenID_HMACSHA1::_strConvert($case["key"]);
- if (strlen($clean["key"]) != $case["key_len"]) {
- trigger_error("Bad key length", E_USER_ERROR);
- }
-
- $clean["data"] =
- Tests_Auth_OpenID_HMACSHA1::_strConvert($case["data"]);
- if (strlen($clean["data"]) != $case["data_len"]) {
- trigger_error("Bad data length", E_USER_ERROR);
- }
-
- $clean["digest"] =
- Tests_Auth_OpenID_HMACSHA1::_strConvert($case["digest"]);
- if (strlen($clean["digest"]) != 20) {
- $l = strlen($clean["digest"]);
- trigger_error("Bad digest length: $l", E_USER_ERROR);
- }
-
- $clean['test_case'] = $case['test_case'];
-
- $final[] = $clean;
- }
- return $final;
- }
-
- function Tests_Auth_OpenID_HMACSHA1($name)
- {
- $this->setName($name);
- $cases = $this->_readTestCases();
- foreach ($cases as $case) {
- $test = new Tests_Auth_OpenID_HMACSHA1_TestCase(
- $case['test_case'],
- $case['key'],
- $case['data'],
- $case['digest']
- );
-
- $digest = $case['digest'];
- $this->addTest($test);
- }
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/KVForm.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/KVForm.php
deleted file mode 100644
index d6bcc7164..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/KVForm.php
+++ /dev/null
@@ -1,259 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/KVForm.php';
-
-$_Tests_Auth_OpenID_kverrors = null;
-/**
- * Keep a list of the logged errors
- */
-function Tests_Auth_OpenID_kvHandleError($errno, $errmsg)
-{
- global $_Tests_Auth_OpenID_kverrors;
- $_Tests_Auth_OpenID_kverrors[] = $errmsg;
-}
-
-
-class Tests_Auth_OpenID_KVForm_TestCase extends PHPUnit_TestCase {
- var $errs;
-
- function runTest()
- {
- // Re-set the number of logged errors
- global $_Tests_Auth_OpenID_kverrors;
- $_Tests_Auth_OpenID_kverrors = array();
-
- set_error_handler("Tests_Auth_OpenID_kvHandleError");
-
- $this->_runTest();
-
- // Check to make sure we have the expected number of logged errors
- //$this->assertEquals($this->errs, count($_Tests_Auth_OpenID_kverrors));
-
- restore_error_handler();
- }
-
- function _runTest()
- {
- trigger_error('Must be overridden', E_USER_ERROR);
- }
-}
-
-class Tests_Auth_OpenID_KVForm_TestCase_Parse
-extends Tests_Auth_OpenID_KVForm_TestCase {
- function Tests_Auth_OpenID_KVForm_TestCase_Parse(
- $arr, $str, $lossy, $errs)
- {
-
- $this->arr = $arr;
- $this->str = $str;
- $this->lossy = $lossy;
- $this->errs = $errs;
- }
-
- function _runTest()
- {
- // Do one parse, after which arrayToKV and kvToArray should be
- // inverses.
- $parsed1 = Auth_OpenID_KVForm::toArray($this->str);
- $serial1 = Auth_OpenID_KVForm::fromArray($this->arr);
-
- if ($this->lossy == "neither" || $this->lossy == "str") {
- $this->assertEquals($this->arr, $parsed1, "str was lossy");
- }
-
- if ($this->lossy == "neither" || $this->lossy == "arr") {
- $this->assertEquals($this->str, $serial1, "array was lossy");
- }
-
- $parsed2 = Auth_OpenID_KVForm::toArray($serial1);
- $serial2 = Auth_OpenID_KVForm::fromArray($parsed1);
-
- // Round-trip both
- $parsed3 = Auth_OpenID_KVForm::toArray($serial2);
- $serial3 = Auth_OpenID_KVForm::fromArray($parsed2);
-
- $this->assertEquals($serial2, $serial3, "serialized forms differ");
-
- // Check to make sure that they're inverses.
- $this->assertEquals($parsed2, $parsed3, "parsed forms differ");
-
- }
-}
-
-class Tests_Auth_OpenID_KVForm_TestCase_Null
-extends Tests_Auth_OpenID_KVForm_TestCase {
- function Tests_Auth_OpenID_KVForm_TestCase_Null($arr, $errs)
- {
- $this->arr = $arr;
- $this->errs = $errs;
- }
-
- function _runTest()
- {
- $serialized = Auth_OpenID_KVForm::fromArray($this->arr);
- $this->assertTrue($serialized === null,
- 'serialization unexpectedly succeeded');
- }
-}
-
-class Tests_Auth_OpenID_KVForm extends PHPUnit_TestSuite {
- function Tests_Auth_OpenID_KVForm($name)
- {
- $this->setName($name);
- $testdata_list = array(
- array("name" => "simple",
- "str" => "college:harvey mudd\n",
- "arr" => array("college" => "harvey mudd"),
- ),
- array("name" => "empty",
- "str" => "",
- "arr" => array(),
- ),
- array("name" => "empty (just newline)",
- "str" => "\n",
- "arr" => array(),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "empty (double newline)",
- "str" => "\n\n",
- "arr" => array(),
- "lossy" => "str",
- "errors" => 2,
- ),
- array("name" => "empty (no colon)",
- "str" => "East is least\n",
- "arr" => array(),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "two keys",
- "str" => "city:claremont\nstate:CA\n",
- "arr" => array('city' => 'claremont',
- 'state' => 'CA'),
- ),
- array("name" => "real life",
- "str" => "is_valid:true\ninvalidate_handle:" .
- "{HMAC-SHA1:2398410938412093}\n",
- "arr" => array('is_valid' => 'true',
- 'invalidate_handle' =>
- '{HMAC-SHA1:2398410938412093}'),
- ),
- array("name" => "empty key and value",
- "str" => ":\n",
- "arr" => array(''=>''),
- ),
- array("name" => "empty key, not value",
- "str" => ":missing key\n",
- "arr" => array(''=>'missing key'),
- ),
- array("name" => "whitespace at front of key",
- "str" => " street:foothill blvd\n",
- "arr" => array('street'=>'foothill blvd'),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "whitespace at front of value",
- "str" => "major: computer science\n",
- "arr" => array('major'=>'computer science'),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "whitespace around key and value",
- "str" => " dorm : east \n",
- "arr" => array('dorm'=>'east'),
- "lossy" => "str",
- "errors" => 2,
- ),
- array("name" => "missing trailing newline",
- "str" => "e^(i*pi)+1:0",
- "arr" => array('e^(i*pi)+1'=>'0'),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "missing trailing newline (two key)",
- "str" => "east:west\nnorth:south",
- "arr" => array('east'=>'west',
- 'north'=>'south'),
- "lossy" => "str",
- "errors" => 1,
- ),
- array("name" => "colon in key",
- "arr" => array("k:k" => 'v'),
- "errors" => 1,
- ),
- array("name" => "newline in key",
- "arr" => array("k\nk" => 'v'),
- "errors" => 1,
- ),
- array("name" => "newline in value",
- "arr" => array('k' => "v\nv"),
- "errors" => 1,
- ),
- array("name" => "array whitespace",
- "arr" => array(" k " => "v"),
- "lossy" => "both",
- "str" => " k :v\n",
- "errors" => 2,
- ),
- array("name" => "array ordering 1",
- "arr" => array("a" => "x",
- "b" => "x",
- "c" => "x"),
- "str" => "a:x\nb:x\nc:x\n",
- ),
- array("name" => "array ordering 2",
- "arr" => array("a" => "x",
- "c" => "x",
- "b" => "x"),
- "str" => "a:x\nc:x\nb:x\n",
- ),
- );
-
- foreach ($testdata_list as $testdata) {
- if (isset($testdata['str'])) {
- $str = $testdata['str'];
- } else {
- $str = null;
- }
-
- $arr = $testdata["arr"];
-
- if (isset($testdata['errors'])) {
- $errs = $testdata["errors"];
- } else {
- $errs = 0;
- }
-
- if (is_null($str)) {
- $test = new Tests_Auth_OpenID_KVForm_TestCase_Null($arr, $errs);
- } else {
- if (isset($testdata['lossy'])) {
- $lossy = $testdata["lossy"];
- } else {
- $lossy = 'neither';
- }
- $test = new Tests_Auth_OpenID_KVForm_TestCase(
- $arr, $str, $lossy, $errs);
- }
- $test->setName($testdata["name"]);
- $this->addTest($test);
- }
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/MemStore.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/MemStore.php
deleted file mode 100644
index 660c2684a..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/MemStore.php
+++ /dev/null
@@ -1,110 +0,0 @@
-assocs = array();
- $this->nonces = array();
- $this->auth_key = $auth_key;
- }
-
- function getKey($server_url, $handle)
- {
- return serialize(array($server_url, $handle));
- }
-
- function getAssocPairs()
- {
- $pairs = array();
- foreach ($this->assocs as $key => $assoc) {
- list($assoc_url, $_) = unserialize($key);
- $pairs[] = array($assoc_url, $assoc);
- }
- return $pairs;
- }
-
- function getServerAssocs($server_url)
- {
- $matches = array();
- foreach ($this->getAssocPairs() as $pair) {
- list($assoc_url, $assoc) = $pair;
- if ($assoc_url == $server_url) {
- $matches[] = $assoc;
- }
- }
- return $matches;
- }
-
- function getAssociation($server_url, $handle=null)
- {
- $assocs = $this->getServerAssocs($server_url);
- if ($handle === null) {
- $best = null;
- foreach ($assocs as $assoc) {
- if (!isset($best) ||
- $best->issued < $assoc->issued) {
-
- $best = $assoc;
- }
- }
- return $best;
- } else {
- foreach ($assocs as $assoc) {
- if ($assoc->handle == $handle) {
- return $assoc;
- }
- }
- return null;
- }
- }
-
- function storeAssociation($server_url, &$association)
- {
- $key = $this->getKey($server_url, $association->handle);
- $this->assocs[$key] = $association;
- }
-
- function removeAssociation($server_url, $handle)
- {
- $key = $this->getKey($server_url, $handle);
- $present = isset($this->assocs[$key]);
- unset($this->assocs[$key]);
- return $present;
- }
-
- function storeNonce($nonce)
- {
- if (!in_array($nonce, $this->nonces)) {
- $this->nonces[] = $nonce;
- }
- }
-
- function useNonce($nonce)
- {
- $index = array_search($nonce, $this->nonces);
- $present = $index !== false;
- if ($present) {
- unset($this->nonces[$index]);
- }
- return $present;
- }
-
- function reset()
- {
- $this->assocs = array();
- $this->nonces = array();
- }
-
- function getAuthKey()
- {
- return $this->auth_key;
- }
-}
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/OpenID_Yadis.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/OpenID_Yadis.php
deleted file mode 100644
index 605bb361e..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/OpenID_Yadis.php
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
-%s
-
-
-';
-
-// Different sets of server URLs for use in the URI tag
-$__server_url_options = array(
- array(), // This case should not generate an endpoint object
- array('http://server.url/'),
- array('https://server.url/'),
- array('https://server.url/', 'http://server.url/'),
- array('https://server.url/',
- 'http://server.url/',
- 'http://example.server.url/'),
- );
-
-// A couple of example extension type URIs. These are not at all
-// official, but are just here for testing.
-$__ext_types = array(
- 'http://janrain.com/extension/blah',
- 'http://openid.net/sreg/1.0');
-
-// All valid combinations of Type tags that should produce an OpenID
-// endpoint
-$__openid_types = array(
- _OPENID_1_0_TYPE,
- _OPENID_1_1_TYPE,
- _OPENID_1_2_TYPE);
-
-$temp = array();
-foreach (__subsets($__ext_types) as $exts) {
- foreach (__subsets($__openid_types) as $ts) {
- if ($ts) {
- $temp[] = array_merge($exts, $ts);
- }
- }
-}
-
-$__type_uri_options = $temp;
-
-// Range of valid Delegate tag values for generating test data
-$__delegate_options = array(
- null,
- 'http://vanity.domain/',
- 'https://somewhere/yadis/');
-
-$temp = array();
-foreach ($__delegate_options as $delegate) {
- foreach ($__type_uri_options as $type_uris) {
- foreach ($__server_url_options as $uris) {
- $temp[] = array($uris, $type_uris, $delegate);
- }
- }
-}
-
-// All combinations of valid URIs, Type URIs and Delegate tags
-$__data = $temp;
-
-function _mkXRDS($services_str)
-{
- global $__XRDS_BOILERPLATE;
- return sprintf($__XRDS_BOILERPLATE, $services_str);
-}
-
-function _mkService($uris = null, $type_uris = null,
- $delegate = null, $dent = ' ')
-{
- $chunks = array($dent, "\n");
- $dent2 = $dent . ' ';
- if ($type_uris) {
- foreach ($type_uris as $type_uri) {
- $chunks = array_merge($chunks,
- array($dent2 . '',
- $type_uri, " \n"));
- }
- }
-
- if ($uris) {
- foreach ($uris as $uri) {
- if (is_array($uri)) {
- list($uri, $prio) = $uri;
- } else {
- $prio = null;
- }
- $chunks = array_merge($chunks, array($dent2, '', $uri, " \n"));
- }
- }
-
- if ($delegate) {
- $chunks = array_merge($chunks,
- array($dent2, '',
- $delegate, " \n"));
- }
-
- $chunks = array_merge($chunks, array($dent, " \n"));
-
- return implode("", $chunks);
-}
-
-// Used for generating test data
-function __subsets($list)
-{
- // Generate all non-empty sublists of a list
- $subsets_list = array(array());
- foreach ($list as $elem) {
-
- $temp = array();
- foreach ($subsets_list as $t) {
- $temp[] = array_merge(array($elem), $t);
- }
-
- $subsets_list = array_merge($subsets_list, $temp);
- }
-
- return $subsets_list;
-}
-
-class Tests_Auth_OpenID_Tester extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_Tester($uris, $type_uris, $delegate)
- {
- $this->uris = $uris;
- $this->type_uris = $type_uris;
- $this->delegate = $delegate;
- parent::PHPUnit_TestCase();
- }
-
- function setUp()
- {
- $this->yadis_url = 'http://unit.test/';
-
- // Create an XRDS document to parse
- $services = _mkService($this->uris,
- $this->type_uris,
- $this->delegate);
- $this->xrds = _mkXRDS($services);
- }
-
- function runTest()
- {
- // Parse into endpoint objects that we will check
- $xrds_object = Services_Yadis_XRDS::parseXRDS($this->xrds);
-
- $endpoints = array();
-
- if ($xrds_object) {
- $endpoints = $xrds_object->services(array('filter_MatchesAnyOpenIDType'));
- $endpoints = Auth_OpenID_makeOpenIDEndpoints($this->yadis_url, $endpoints);
- }
-
- // make sure there are the same number of endpoints as
- // URIs. This assumes that the type_uris contains at least one
- // OpenID type.
- $this->assertEquals(count($this->uris), count($endpoints),
- "URI <-> Endpoint count");
-
- // So that we can check equality on the endpoint types
- $type_uris = $this->type_uris;
- sort($type_uris);
-
-
- $seen_uris = array();
- foreach ($endpoints as $endpoint) {
- $seen_uris[] = $endpoint->server_url;
-
- // All endpoints will have same yadis_url
- $this->assertEquals($this->yadis_url, $endpoint->identity_url);
-
- // and delegate
- $this->assertEquals($this->delegate, $endpoint->delegate);
-
- // and types
- $actual_types = $endpoint->type_uris;
- sort($actual_types);
- $this->assertEquals($actual_types, $type_uris);
- }
-
- // So that they will compare equal, because we don't care what
- // order they are in
- sort($seen_uris);
- $uris = $this->uris;
- sort($uris);
-
- // Make sure we saw all URIs, and saw each one once
- $this->assertEquals($uris, $seen_uris);
- }
-}
-
-class Tests_Auth_OpenID_OpenID_Yadis extends PHPUnit_TestSuite {
- function Tests_Auth_OpenID_OpenID_Yadis()
- {
- global $__data;
- foreach ($__data as $case) {
- $this->addTest(new Tests_Auth_OpenID_Tester($case[0], $case[1], $case[2]));
- }
- }
-
- function getName()
- {
- return 'Tests_Auth_OpenID_OpenID_Yadis';
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Parse.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Parse.php
deleted file mode 100644
index 174865144..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Parse.php
+++ /dev/null
@@ -1,181 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'Tests/Auth/OpenID/TestUtil.php';
-require_once 'Auth/OpenID/Parse.php';
-require_once 'PHPUnit.php';
-
-class Tests_Auth_OpenID_Link extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_Link($case)
- {
- list($desc, $markup, $links, $case_text) = $case;
- $this->desc = $desc;
- $this->markup = $markup;
- $this->expected_links = $links;
- $this->case_text = $case_text;
- $this->parser = new Auth_OpenID_Parse();
- }
-
- function getName()
- {
- return $this->desc;
- }
-
- function runTest()
- {
- $parsed = $this->parser->parseLinkAttrs($this->markup);
- $i = 0;
-
- foreach ($this->expected_links as $expected) {
- list($is_optional_link, $expected_link) = $expected;
- if ($is_optional_link &&
- ($i >= count($parsed))) {
- continue;
- }
-
- $act_link = $parsed[$i];
-
- $increment = true;
- foreach ($expected_link as $attr => $data) {
- list($is_optional_attr, $value) = $data;
-
- if ($is_optional_attr) {
- $actual_value = null;
- if (array_key_exists($attr, $act_link)) {
- $actual_value = $act_link[$attr];
- } else {
- continue;
- }
- } else {
- $actual_value = $act_link[$attr];
- }
-
- if ($is_optional_link &&
- ($value != $actual_value)) {
- $increment = false;
- break;
- }
-
- $this->assertEquals($value, $actual_value);
- }
-
- if ($increment) {
- $i++;
- }
- }
-
- $this->assertEquals($i, count($parsed));
- }
-}
-
-class NumTestCases extends PHPUnit_TestCase {
- function NumTestCases($test_cases, $num_tests)
- {
- $this->test_cases = $test_cases;
- $this->num_tests = $num_tests;
- }
-
- function runTest()
- {
- $this->assertEquals(count($this->test_cases),
- $this->num_tests);
- }
-}
-
-class Tests_Auth_OpenID_Parse extends PHPUnit_TestSuite {
-
- function getName()
- {
- return "Tests_Auth_OpenID_Parse";
- }
-
- function _parseCheck($cond, $where)
- {
- if (!$cond) {
- trigger_error('Parse error in ' . $where, E_USER_ERROR);
- }
- }
-
- function parseLink($line)
- {
- $parts = explode(" ", $line);
- $optional = intval($parts[0] == 'Link*:');
- $this->_parseCheck($optional || ($parts[0] == 'Link:'), __FUNCTION__);
-
- $attrs = array();
- foreach (array_slice($parts, 1) as $attr) {
- list($k, $v) = explode("=", $attr, 2);
- if ($k[strlen($k) - 1] == '*') {
- $attr_optional = 1;
- $k = substr($k, 0, strlen($k) - 1);
- } else {
- $attr_optional = 0;
- }
-
- $attrs[$k] = array($attr_optional, $v);
- }
-
- return array($optional, $attrs);
- }
-
- function parseCase($s)
- {
- list($header, $markup) = explode("\n\n", $s, 2);
- $lines = explode("\n", $header);
- $name = array_shift($lines);
- $this->_parseCheck(strpos($name, 'Name: ') == 0, __FUNCTION__);
- $desc = substr($name, 6);
- $parsed = array();
- foreach ($lines as $line) {
- $parsed[] = $this->parseLink($line);
- }
-
- return array($desc, $markup, $parsed);
- }
-
- function parseTests($s)
- {
- $tests = array();
-
- $cases = explode("\n\n\n", $s);
- $header = array_shift($cases);
- list($tests_line, $unused) = explode("\n", $header, 2);
- list($k, $v) = explode(": ", $tests_line);
- $this->_parseCheck(('Num Tests' == $k), __FUNCTION__);
- $num_tests = intval($v);
-
- foreach (array_slice($cases, 0, count($cases) - 1) as $case) {
- list($desc, $markup, $links) = $this->parseCase($case);
- $tests[] = array($desc, $markup, $links, $case);
- }
-
- return array($num_tests, $tests);
- }
-
- function Tests_Auth_OpenID_Parse()
- {
- $test_data = Tests_Auth_OpenID_readdata('linkparse.txt');
-
- list($num_tests, $test_cases) = $this->parseTests($test_data);
-
- $this->addTest(new NumTestCases($test_cases, $num_tests));
-
- foreach ($test_cases as $case) {
- $this->addTest(new Tests_Auth_OpenID_Link($case));
- }
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Server.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Server.php
deleted file mode 100644
index 231272b52..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Server.php
+++ /dev/null
@@ -1,1391 +0,0 @@
-init("1423261515703355186607439952816216983770".
- "5735494988446894302176757360889904836136".
- "0422513557553514790045512299468953431585".
- "3008125488594198571710943663581589034331".
- "6791551733211386105974742540867014420109".
- "9811846875730766487278261498262568348338".
- "4764372005569983660877797099908075182915".
- "81860338635288400119293970087"
- );
- }
-
- return $num;
-}
-
-$ALT_GEN = 5;
-
-function arrayToString($arr)
-{
- $s = "Array(";
-
- $parts = array();
- foreach ($arr as $k => $v) {
- if (is_array($v)) {
- $v = arrayToString($v);
- }
- $parts[] = sprintf("%s => %s", $k, $v);
- }
-
- $s .= implode(", ", $parts);
- $s .= ")";
-
- return $s;
-}
-
-function _Auth_OpenID_NotAuthorized()
-{
- return false;
-}
-
-class Tests_Auth_OpenID_Test_ServerError extends PHPUnit_TestCase {
- function test_browserWithReturnTo()
- {
- $return_to = "http://rp.unittest/consumer";
- // will be a ProtocolError raised by Decode or CheckIDRequest.answer
- $args = array(
- 'openid.mode' => 'monkeydance',
- 'openid.identity' => 'http://wagu.unittest/',
- 'openid.return_to' => $return_to);
- $e = new Auth_OpenID_ServerError($args, "plucky");
- $this->assertTrue($e->hasReturnTo());
- $expected_args = array(
- 'openid.mode' => 'error',
- 'openid.error' => 'plucky');
-
- $encoded = $e->encodeToURL();
- if (_isError($encoded)) {
- $this->fail($encoded->toString());
- return;
- }
-
- list($rt_base, $_result_args) = explode("?", $e->encodeToURL(), 2);
- $result_args = array();
- parse_str($_result_args, $result_args);
- $result_args = Auth_OpenID::fixArgs($result_args);
-
- $this->assertEquals($result_args, $expected_args);
- }
-
- function test_noReturnTo()
- {
- // will be a ProtocolError raised by Decode or CheckIDRequest.answer
- $args = array(
- 'openid.mode' => 'zebradance',
- 'openid.identity' => 'http://wagu.unittest/');
-
- $e = new Auth_OpenID_ServerError($args, "waffles");
- $this->assertFalse($e->hasReturnTo());
- $expected = "error:waffles\nmode:error\n";
- $this->assertEquals($e->encodeToKVForm(), $expected);
- }
-}
-
-class Tests_Auth_OpenID_Test_Decode extends PHPUnit_TestCase {
- function setUp()
- {
- $this->id_url = "http://decoder.am.unittest/";
- $this->rt_url = "http://rp.unittest/foobot/?qux=zam";
- $this->tr_url = "http://rp.unittest/";
- $this->assoc_handle = "{assoc}{handle}";
- $this->decoder = new Auth_OpenID_Decoder();
- }
-
- function test_none()
- {
- $args = array();
- $r = $this->decoder->decode($args);
- $this->assertEquals($r, null);
- }
-
- function test_irrelevant()
- {
- $args = array(
- 'pony' => 'spotted',
- 'sreg.mutant_power' => 'decaffinator');
-
- $r = $this->decoder->decode($args);
-
- $this->assertTrue($r === null);
- }
-
- function test_bad()
- {
- $args = array(
- 'openid.mode' => 'twos-compliment',
- 'openid.pants' => 'zippered');
-
- // Be sure that decoding the args returns an error.
- $result = $this->decoder->decode($args);
-
- $this->assertTrue(_isError($result));
- }
-
- function test_checkidImmediate()
- {
- $args = array(
- 'openid.mode' => 'checkid_immediate',
- 'openid.identity' => $this->id_url,
- 'openid.assoc_handle' => $this->assoc_handle,
- 'openid.return_to' => $this->rt_url,
- 'openid.trust_root' => $this->tr_url,
- # should be ignored
- 'openid.some.extension' => 'junk');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_CheckIDRequest'));
- $this->assertEquals($r->mode, "checkid_immediate");
- $this->assertEquals($r->immediate, true);
- $this->assertEquals($r->identity, $this->id_url);
- $this->assertEquals($r->trust_root, $this->tr_url);
- $this->assertEquals($r->return_to, $this->rt_url);
- $this->assertEquals($r->assoc_handle, $this->assoc_handle);
- }
-
- function test_checkidSetup()
- {
- $args = array(
- 'openid.mode' => 'checkid_setup',
- 'openid.identity' => $this->id_url,
- 'openid.assoc_handle' => $this->assoc_handle,
- 'openid.return_to' => $this->rt_url,
- 'openid.trust_root' => $this->tr_url);
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_CheckIDRequest'));
- $this->assertEquals($r->mode, "checkid_setup");
- $this->assertEquals($r->immediate, false);
- $this->assertEquals($r->identity, $this->id_url);
- $this->assertEquals($r->trust_root, $this->tr_url);
- $this->assertEquals($r->return_to, $this->rt_url);
- }
-
- function test_checkidSetupNoIdentity()
- {
- $args = array(
- 'openid.mode' => 'checkid_setup',
- 'openid.assoc_handle' => $this->assoc_handle,
- 'openid.return_to' => $this->rt_url,
- 'openid.trust_root' => $this->tr_url);
-
- $result = $this->decoder->decode($args);
- if (_isError($result)) {
- $this->assertTrue($result->query);
- } else {
- $this->fail(sprintf("Expected Auth_OpenID_Error, instead " .
- "returned with %s", gettype($result)));
- }
- }
-
- function test_checkidSetupNoReturn()
- {
- $args = array(
- 'openid.mode' => 'checkid_setup',
- 'openid.identity' => $this->id_url,
- 'openid.assoc_handle' => $this->assoc_handle,
- 'openid.trust_root' => $this->tr_url);
-
- $result = $this->decoder->decode($args);
- if (!_isError($result)) {
- $this->fail("Expected Auth_OpenID_Error");
- }
- }
-
- function test_checkidSetupBadReturn()
- {
- $args = array(
- 'openid.mode' => 'checkid_setup',
- 'openid.identity' => $this->id_url,
- 'openid.assoc_handle' => $this->assoc_handle,
- 'openid.return_to' => 'not a url');
-
- $result = $this->decoder->decode($args);;
- if (_isError($result)) {
- $this->assertTrue($result->query);
- } else {
- $this->fail(sprintf("Expected ProtocolError, instead " .
- "returned with %s", gettype($result)));
- }
- }
-
- function test_checkAuth()
- {
- $args = array(
- 'openid.mode' => 'check_authentication',
- 'openid.assoc_handle' => '{dumb}{handle}',
- 'openid.sig' => 'sigblob',
- 'openid.signed' => 'foo,bar,mode',
- 'openid.foo' => 'signedval1',
- 'openid.bar' => 'signedval2',
- 'openid.baz' => 'unsigned');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_CheckAuthRequest'));
- $this->assertEquals($r->mode, 'check_authentication');
- $this->assertEquals($r->sig, 'sigblob');
- $this->assertEquals($r->signed, array(
- array('foo', 'signedval1'),
- array('bar', 'signedval2'),
- array('mode', 'id_res')));
- }
-
- function test_checkAuthMissingSignedField()
- {
- $args = array(
- 'openid.mode' => 'check_authentication',
- 'openid.assoc_handle' => '{dumb}{handle}',
- 'openid.sig' => 'sigblob',
- 'openid.signed' => 'foo,bar,mode',
- 'openid.foo' => 'signedval1',
- 'openid.baz' => 'unsigned');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
-
- function test_checkAuthMissingSignature()
- {
- $args = array(
- 'openid.mode' => 'check_authentication',
- 'openid.assoc_handle' => '{dumb}{handle}',
- 'openid.signed' => 'foo,bar,mode',
- 'openid.foo' => 'signedval1',
- 'openid.bar' => 'signedval2',
- 'openid.baz' => 'unsigned');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
-
- function test_checkAuthAndInvalidate()
- {
- $args = array(
- 'openid.mode' => 'check_authentication',
- 'openid.assoc_handle' => '{dumb}{handle}',
- 'openid.invalidate_handle' => '[[SMART_handle]]',
- 'openid.sig' => 'sigblob',
- 'openid.signed' => 'foo,bar,mode',
- 'openid.foo' => 'signedval1',
- 'openid.bar' => 'signedval2',
- 'openid.baz' => 'unsigned');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_CheckAuthRequest'));
- $this->assertEquals($r->invalidate_handle, '[[SMART_handle]]');
- }
-
- function test_associateDH()
- {
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "Rzup9265tw==");
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_AssociateRequest'));
- $this->assertEquals($r->mode, "associate");
- $this->assertEquals($r->session->session_type, "DH-SHA1");
- $this->assertEquals($r->assoc_type, "HMAC-SHA1");
- $this->assertTrue($r->session->consumer_pubkey);
- }
- }
-
- function test_associateDHMissingKey()
- {
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1');
-
- // Using DH-SHA1 without supplying dh_consumer_public is an error.
- $result = $this->decoder->decode($args);
- if (!_isError($result)) {
- $this->fail(sprintf("Expected Auth_OpenID_ServerError, got %s",
- gettype($result)));
- }
- }
-
- /**
- * XXX: Cannot produce a value to break base64_decode
- function test_associateDHpubKeyNotB64()
- {
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "donkeydonkeydonkey");
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
- */
-
- function test_associateDHModGen()
- {
- global $ALT_GEN;
-
- // test dh with non-default but valid values for dh_modulus
- // and dh_gen
- $lib =& Auth_OpenID_getMathLib();
-
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "Rzup9265tw==",
- 'openid.dh_modulus' => $lib->longToBase64(altModulus()),
- 'openid.dh_gen' => $lib->longToBase64($ALT_GEN));
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_AssociateRequest'));
- $this->assertEquals($r->mode, "associate");
- $this->assertEquals($r->session->session_type, "DH-SHA1");
- $this->assertEquals($r->assoc_type, "HMAC-SHA1");
- $this->assertTrue($lib->cmp($r->session->dh->mod, altModulus()) === 0);
- $this->assertTrue($lib->cmp($r->session->dh->gen, $ALT_GEN) === 0);
- $this->assertTrue($r->session->consumer_pubkey);
- }
-
- /**
- * XXX: Can't test invalid base64 values for mod and gen because
- * PHP's base64 decoder is much too forgiving or just plain
- * broken.
- function test_associateDHCorruptModGen()
- {
- // test dh with non-default but valid values for dh_modulus
- // and dh_gen
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "Rzup9265tw==",
- 'openid.dh_modulus' => 'pizza',
- 'openid.dh_gen' => 'gnocchi');
-
- $r = $this->decoder->decode($args);
- print_r($r);
-
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
- */
-
- function test_associateDHMissingModGen()
- {
- // test dh with non-default but valid values for dh_modulus
- // and dh_gen
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "Rzup9265tw==",
- 'openid.dh_modulus' => 'pizza');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
-
- function test_associateWeirdSession()
- {
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.session_type' => 'FLCL6',
- 'openid.dh_consumer_public' => "YQ==\n");
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_ServerError'));
- }
-
- function test_associatePlain()
- {
- $args = array('openid.mode' => 'associate');
-
- $r = $this->decoder->decode($args);
- $this->assertTrue(is_a($r, 'Auth_OpenID_AssociateRequest'));
- $this->assertEquals($r->mode, "associate");
- $this->assertEquals($r->session->session_type, "plaintext");
- $this->assertEquals($r->assoc_type, "HMAC-SHA1");
- }
-
- function test_nomode()
- {
- $args = array(
- 'openid.session_type' => 'DH-SHA1',
- 'openid.dh_consumer_public' => "my public keeey");
-
- $result = $this->decoder->decode($args);
- if (!_isError($result)) {
- $this->fail(sprintf("Expected Auth_OpenID_Error",
- gettype($result)));
- }
- }
-}
-
-class Tests_Auth_OpenID_Test_Encode extends PHPUnit_TestCase {
- function setUp()
- {
- $this->encoder = new Auth_OpenID_Encoder();
- $this->encode = $this->encoder;
- }
-
- function test_id_res()
- {
- $request = new Auth_OpenID_CheckIDRequest(
- 'http://bombom.unittest/',
- 'http://burr.unittest/',
- 'http://burr.unittest/999',
- false);
-
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array(
- 'mode' => 'id_res',
- 'identity' => $request->identity,
- 'return_to' => $request->return_to);
-
- $webresponse = $this->encoder->encode($response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_REDIRECT);
- $this->assertTrue(array_key_exists('location',
- $webresponse->headers));
-
- $location = $webresponse->headers['location'];
- $this->assertTrue(strpos($location, $request->return_to) === 0);
- // "%s does not start with %s" % ($location,
- // $request->return_to));
-
- $parsed = parse_url($location);
- $query = array();
- parse_str($parsed['query'], $query);
- $query = Auth_OpenID::fixArgs($query);
-
- $expected = array();
-
- foreach ($response->fields as $k => $v) {
- $expected['openid.' . $k] = $v;
- }
-
- $this->assertEquals($query, $expected);
- }
-
- function test_cancel()
- {
- $request = new Auth_OpenID_CheckIDRequest(
- 'http://bombom.unittest/',
- 'http://burr.unittest/',
- 'http://burr.unittest/999',
- false);
-
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array('mode' => 'cancel');
-
- $webresponse = $this->encoder->encode($response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_REDIRECT);
- $this->assertTrue(array_key_exists('location', $webresponse->headers));
- }
-
- function test_assocReply()
- {
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $request = Auth_OpenID_AssociateRequest::fromQuery(array());
- $response = new Auth_OpenID_ServerResponse($request);
- $response->fields = array('assoc_handle' => "every-zig");
- $webresponse = $this->encoder->encode($response);
- $body = "assoc_handle:every-zig\n";
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK);
- $this->assertEquals($webresponse->headers, array());
- $this->assertEquals($webresponse->body, $body);
- }
- }
-
- function test_checkauthReply()
- {
- $request = new Auth_OpenID_CheckAuthRequest('a_sock_monkey',
- 'siggggg',
- array());
- $response = new Auth_OpenID_ServerResponse($request);
- $response->fields = array(
- 'is_valid' => 'true',
- 'invalidate_handle' => 'xXxX:xXXx');
-
- $body = "invalidate_handle:xXxX:xXXx\nis_valid:true\n";
- $webresponse = $this->encoder->encode($response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK);
- $this->assertEquals($webresponse->headers, array());
- $this->assertEquals($webresponse->body, $body);
- }
-
- function test_unencodableError()
- {
- $args = array('openid.identity' => 'http://limu.unittest/');
-
- $e = new Auth_OpenID_ServerError($args, "wet paint");
-
- $result = $this->encoder->encode($e);
- if (!_isError($result, 'Auth_OpenID_EncodingError')) {
- $this->fail(sprintf("Expected Auth_OpenID_ServerError, got %s",
- gettype($result)));
- }
- }
-
- function test_encodableError()
- {
- $args = array(
- 'openid.mode' => 'associate',
- 'openid.identity' => 'http://limu.unittest/');
-
- $body="error:snoot\nmode:error\n";
- $err = new Auth_OpenID_ServerError($args, "snoot");
- $webresponse = $this->encoder->encode($err);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_ERROR);
- $this->assertEquals($webresponse->headers, array());
- $this->assertEquals($webresponse->body, $body);
- }
-}
-
-class Tests_Auth_OpenID_SigningEncode extends PHPUnit_TestCase {
- function setUp()
- {
- // Use filestore here instead of memstore
- $this->store = new Tests_Auth_OpenID_MemStore();
-
- $this->request = new Auth_OpenID_CheckIDRequest(
- 'http://bombom.unittest/',
- 'http://burr.unittest/',
- 'http://burr.unittest/999',
- false);
-
- $this->response = new Auth_OpenID_CheckIDResponse($this->request);
- $this->response->fields = array(
- 'mode' => 'id_res',
- 'identity' => $this->request->identity,
- 'return_to' => $this->request->return_to);
-
- $this->signatory = new Auth_OpenID_Signatory($this->store);
- $this->dumb_key = $this->signatory->dumb_key;
- $this->normal_key = $this->signatory->normal_key;
-
- $this->encoder = new Auth_OpenID_SigningEncoder($this->signatory);
- }
-
- function test_idres()
- {
- $assoc_handle = '{bicycle}{shed}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(60, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
- $this->store->storeAssociation($this->normal_key, $assoc);
- $this->request->assoc_handle = $assoc_handle;
- $webresponse = $this->encoder->encode($this->response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_REDIRECT);
- $this->assertTrue(array_key_exists('location',
- $webresponse->headers));
-
- $location = $webresponse->headers['location'];
- $parsed = parse_url($location);
- $query = array();
- parse_str($parsed['query'], $query);
- $query = Auth_OpenID::fixArgs($query);
-
- $this->assertTrue(array_key_exists('openid.sig', $query));
- $this->assertTrue(array_key_exists('openid.assoc_handle', $query));
- $this->assertTrue(array_key_exists('openid.signed', $query));
- }
-
- function test_idresDumb()
- {
- $webresponse = $this->encoder->encode($this->response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_REDIRECT);
- $this->assertTrue(array_key_exists('location', $webresponse->headers));
-
- $location = $webresponse->headers['location'];
- $parsed = parse_url($location);
- $query = array();
- parse_str($parsed['query'], $query);
- $query = Auth_OpenID::fixArgs($query);
- $this->assertTrue(array_key_exists('openid.sig', $query));
- $this->assertTrue(array_key_exists('openid.assoc_handle', $query));
- $this->assertTrue(array_key_exists('openid.signed', $query));
- }
-
- function test_forgotStore()
- {
- $this->encoder->signatory = null;
- $result = $this->encoder->encode($this->response);
- if (!is_a($result, 'Auth_OpenID_ServerError')) {
- $this->fail(sprintf("Expected Auth_OpenID_ServerError, got %s",
- gettype($result)));
- }
- }
-
- function test_cancel()
- {
- $request = new Auth_OpenID_CheckIDRequest(
- 'http://bombom.unittest/',
- 'http://burr.unittest/',
- 'http://burr.unittest/999',
- false);
-
- $response = new Auth_OpenID_CheckIDResponse($request, 'cancel');
- $webresponse = $this->encoder->encode($response);
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_REDIRECT);
- $this->assertTrue(array_key_exists('location', $webresponse->headers));
- $location = $webresponse->headers['location'];
- $parsed = parse_url($location);
- $query = array();
- parse_str($parsed['query'], $query);
- $query = Auth_OpenID::fixArgs($query);
- $this->assertFalse(array_key_exists('openid.sig', $query));
- }
-
- function test_assocReply()
- {
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $request = Auth_OpenID_AssociateRequest::fromQuery(array());
- $response = new Auth_OpenID_ServerResponse($request);
- $response->fields = array('assoc_handle' => "every-zig");
- $webresponse = $this->encoder->encode($response);
- $body = "assoc_handle:every-zig\n";
-
- $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK);
- $this->assertEquals($webresponse->headers, array());
- $this->assertEquals($webresponse->body, $body);
- }
- }
-
- function test_alreadySigned()
- {
- $this->response->fields['sig'] = 'priorSig==';
- $result = $this->encoder->encode($this->response);
- if (!is_a($result, 'Auth_OpenID_AlreadySigned')) {
- $this->fail(sprintf("Expected Auth_OpenID_AlreadySigned " .
- "instance, got %s", gettype($result)));
- }
- }
-}
-
-class Tests_Auth_OpenID_CheckID extends PHPUnit_TestCase {
- function setUp()
- {
- $this->request = new Auth_OpenID_CheckIDRequest(
- 'http://bambam.unittest/',
- 'http://bar.unittest/999',
- 'http://bar.unittest/',
- false);
- }
-
- function test_trustRootInvalid()
- {
- $this->request->trust_root = "http://foo.unittest/17";
- $this->request->return_to = "http://foo.unittest/39";
- $this->assertFalse($this->request->trustRootValid());
- }
-
- function test_trustRootValid()
- {
- $this->request->trust_root = "http://foo.unittest/";
- $this->request->return_to = "http://foo.unittest/39";
- $this->assertTrue($this->request->trustRootValid());
- }
-
- function test_answerToInvalidRoot()
- {
- $this->request->trust_root = "http://foo.unittest/17";
- $this->request->return_to = "http://foo.unittest/39";
- $result = $this->request->answer(true);
- if (!is_a($result, 'Auth_OpenID_UntrustedReturnURL')) {
- $this->fail(sprintf("Expected Auth_OpenID_UntrustedReturnURL, " .
- "got %s", gettype($result)));
- }
- $this->assertTrue($this->request->answer(false));
- }
-
- function test_answerAllow()
- {
- $answer = $this->request->answer(true);
-
- if (_isError($answer)) {
- $this->fail($answer->toString());
- return;
- }
-
- $this->assertEquals($answer->request, $this->request);
- $this->assertEquals($answer->fields, array(
- 'mode' => 'id_res',
- 'identity' => $this->request->identity,
- 'return_to' => $this->request->return_to));
-
- $this->assertEquals($answer->signed,
- array("mode", "identity", "return_to"));
- }
-
- function test_answerAllowNoTrustRoot()
- {
- $this->request->trust_root = null;
- $answer = $this->request->answer(true);
- $this->assertEquals($answer->request, $this->request);
- $this->assertEquals($answer->fields, array(
- 'mode' => 'id_res',
- 'identity' => $this->request->identity,
- 'return_to' => $this->request->return_to));
-
- $this->assertEquals($answer->signed,
- array("mode", "identity", "return_to"));
- }
-
- function test_answerImmediateDeny()
- {
- $this->request->mode = 'checkid_immediate';
- $this->request->immediate = true;
- $server_url = "http://setup-url.unittest/";
- $answer = $this->request->answer(false, $server_url);
- $this->assertEquals($answer->request, $this->request);
- $this->assertEquals(count($answer->fields), 2);
- $this->assertEquals(Auth_OpenID::arrayGet($answer->fields, 'mode'),
- 'id_res');
- $this->assertTrue(strpos(Auth_OpenID::arrayGet($answer->fields,
- 'user_setup_url'),
- $server_url) == 0);
-
- $this->assertEquals($answer->signed, array());
- }
-
- function test_answerSetupDeny()
- {
- $answer = $this->request->answer(false);
- $this->assertEquals($answer->fields, array('mode' => 'cancel'));
- $this->assertEquals($answer->signed, array());
- }
-
- function test_getCancelURL()
- {
- $url = $this->request->getCancelURL();
- $expected = $this->request->return_to . '?openid.mode=cancel';
- $this->assertEquals($url, $expected);
- }
-
- function test_getCancelURLimmed()
- {
- $this->request->mode = 'checkid_immediate';
- $this->request->immediate = true;
- $result = $this->request->getCancelURL();
- if (!is_a($result, 'Auth_OpenID_ServerError')) {
- $this->fail(sprintf("Expected Auth_OpenID_ServerError, got %s",
- gettype($result)));
- }
- }
-}
-
-class Tests_Auth_OpenID_CheckIDExtension extends PHPUnit_TestCase {
-
- function setUp()
- {
- $this->request = new Auth_OpenID_CheckIDRequest(
- 'http://bambam.unittest/',
- 'http://bar.unittest/',
- 'http://bar.unittest/999',
- false);
-
- $this->response = new Auth_OpenID_CheckIDResponse($this->request);
- $this->response->fields['blue'] = 'star';
- }
-
- function test_addField()
- {
- $namespace = 'mj12';
- $this->response->addField($namespace, 'bright', 'potato');
- $this->assertEquals($this->response->fields,
- array('blue' => 'star',
- 'mode' => 'id_res',
- 'mj12.bright' => 'potato'));
- $this->assertEquals($this->response->signed,
- array('mode', 'identity', 'return_to',
- 'mj12.bright'));
- }
-
- function test_addFieldUnsigned()
- {
- $namespace = 'mj12';
- $this->response->addField($namespace, 'dull', 'lemon', false);
- $this->assertEquals($this->response->fields,
- array('blue' => 'star',
- 'mode' => 'id_res',
- 'mj12.dull' => 'lemon'));
- $this->assertEquals($this->response->signed,
- array('mode', 'identity', 'return_to'));
- }
-
- function test_addFields()
- {
- $namespace = 'mi5';
- $this->response->addFields($namespace, array('tangy' => 'suspenders',
- 'bravo' => 'inclusion'));
- $this->assertEquals($this->response->fields,
- array('blue' => 'star',
- 'mode' => 'id_res',
- 'mi5.tangy' => 'suspenders',
- 'mi5.bravo' => 'inclusion'));
- $this->assertEquals($this->response->signed,
- array('mode', 'identity', 'return_to',
- 'mi5.tangy', 'mi5.bravo'));
- }
-
- function test_addFieldsUnsigned()
- {
- $namespace = 'mi5';
- $this->response->addFields($namespace, array('strange' => 'conditioner',
- 'elemental' => 'blender'),
- false);
- $this->assertEquals($this->response->fields,
- array('blue' => 'star',
- 'mode' => 'id_res',
- 'mi5.strange' => 'conditioner',
- 'mi5.elemental' => 'blender'));
- $this->assertEquals($this->response->signed,
- array('mode', 'identity', 'return_to'));
- }
-
- function test_update()
- {
- $eresponse = new Auth_OpenID_ServerResponse(null);
- $eresponse->fields = array('shape' => 'heart',
- 'content' => 'strings,wire');
- $eresponse->signed = array('content');
- $this->response->update('box', $eresponse);
- $this->assertEquals($this->response->fields,
- array('blue' => 'star',
- 'mode' => 'id_res',
- 'box.shape' => 'heart',
- 'box.content' => 'strings,wire'));
- $this->assertEquals($this->response->signed,
- array('mode', 'identity', 'return_to', 'content'));
- }
-}
-
-class _MockSignatory {
- var $isValid = true;
-
- function _MockSignatory($assoc)
- {
- $this->assocs = array($assoc);
- }
-
- function verify($assoc_handle, $sig, $signed_pairs)
- {
- if (!$sig) {
- return false;
- }
-
- if (!is_array($signed_pairs)) {
- return false;
- }
-
- if (in_array(array(true, $assoc_handle), $this->assocs)) {
- return $this->isValid;
- } else {
- return false;
- }
- }
-
- function getAssociation($assoc_handle, $dumb)
- {
- if (in_array(array($dumb, $assoc_handle), $this->assocs)) {
- // This isn't a valid implementation for many uses of this
- // function, mind you.
- return true;
- } else {
- return null;
- }
- }
-
- function invalidate($assoc_handle, $dumb)
- {
- if (in_array(array($dumb, $assoc_handle), $this->assocs)) {
- $i = 0;
- foreach ($this->assocs as $pair) {
- if ($pair == array($dumb, $assoc_handle)) {
- unset($this->assocs[$i]);
- break;
- }
- $i++;
- }
- }
- }
-}
-
-class Tests_Auth_OpenID_CheckAuth extends PHPUnit_TestCase {
- function setUp()
- {
- $this->assoc_handle = 'mooooooooo';
- $this->request = new Auth_OpenID_CheckAuthRequest(
- $this->assoc_handle, 'signarture',
- array(array('one', 'alpha'),
- array('two', 'beta')));
-
- $this->signatory = new _MockSignatory(array(true, $this->assoc_handle));
- }
-
- function test_valid()
- {
- $r = $this->request->answer($this->signatory);
- $this->assertEquals($r->fields, array('is_valid' => 'true'));
- $this->assertEquals($r->request, $this->request);
- }
-
- function test_invalid()
- {
- $this->signatory->isValid = false;
- $r = $this->request->answer($this->signatory);
- $this->assertEquals($r->fields, array('is_valid' => 'false'));
- }
-
- function test_replay()
- {
- $r = $this->request->answer($this->signatory);
- $r = $this->request->answer($this->signatory);
- $this->assertEquals($r->fields, array('is_valid' => 'false'));
- }
-
- function test_invalidatehandle()
- {
- $this->request->invalidate_handle = "bogusHandle";
- $r = $this->request->answer($this->signatory);
- $this->assertEquals($r->fields,
- array('is_valid' => 'true',
- 'invalidate_handle' => "bogusHandle"));
- $this->assertEquals($r->request, $this->request);
- }
-
- function test_invalidatehandleNo()
- {
- $assoc_handle = 'goodhandle';
- $this->signatory->assocs[] = array(false, 'goodhandle');
- $this->request->invalidate_handle = $assoc_handle;
- $r = $this->request->answer($this->signatory);
- $this->assertEquals($r->fields, array('is_valid' => 'true'));
- }
-}
-
-class Tests_Auth_OpenID_Associate extends PHPUnit_TestCase {
- // TODO: test DH with non-default values for modulus and gen.
- // (important to do because we actually had it broken for a
- // while.)
-
- function setUp()
- {
- $this->request = Auth_OpenID_AssociateRequest::fromQuery(array());
- $this->store = new Tests_Auth_OpenID_MemStore();
- $this->signatory = new Auth_OpenID_Signatory($this->store);
- $this->assoc = $this->signatory->createAssociation(false);
- }
-
- function test_dh()
- {
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $dh = new Auth_OpenID_DiffieHellman();
- $ml =& Auth_OpenID_getMathLib();
-
- $cpub = $dh->public;
- $session = new Auth_OpenID_DiffieHellmanServerSession(
- new Auth_OpenID_DiffieHellman(),
- $cpub);
-
- $this->request = new Auth_OpenID_AssociateRequest($session);
- $response = $this->request->answer($this->assoc);
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "assoc_type"),
- "HMAC-SHA1");
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "assoc_handle"),
- $this->assoc->handle);
-
- $this->assertFalse(
- Auth_OpenID::arrayGet($response->fields, "mac_key"));
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "session_type"),
- "DH-SHA1");
-
- $this->assertTrue(
- Auth_OpenID::arrayGet($response->fields, "enc_mac_key"));
-
- $this->assertTrue(
- Auth_OpenID::arrayGet($response->fields,
- "dh_server_public"));
-
- $enc_key = base64_decode(
- Auth_OpenID::arrayGet($response->fields, "enc_mac_key"));
-
- $spub = $ml->base64ToLong(
- Auth_OpenID::arrayGet($response->fields,
- "dh_server_public"));
-
- $secret = $dh->xorSecret($spub, $enc_key);
-
- $this->assertEquals($secret, $this->assoc->secret);
- }
- }
-
- function test_plaintext()
- {
- $response = $this->request->answer($this->assoc);
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "assoc_type"),
- "HMAC-SHA1");
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "assoc_handle"),
- $this->assoc->handle);
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "expires_in"),
- sprintf("%d", $this->signatory->SECRET_LIFETIME));
-
- $this->assertEquals(
- Auth_OpenID::arrayGet($response->fields, "mac_key"),
- base64_encode($this->assoc->secret));
-
- $this->assertFalse(Auth_OpenID::arrayGet($response->fields,
- "session_type"));
-
- $this->assertFalse(Auth_OpenID::arrayGet($response->fields,
- "enc_mac_key"));
-
- $this->assertFalse(Auth_OpenID::arrayGet($response->fields,
- "dh_server_public"));
- }
-}
-
-class Counter {
- function Counter()
- {
- $this->count = 0;
- }
-
- function inc()
- {
- $this->count += 1;
- }
-}
-
-class Tests_Auth_OpenID_ServerTest extends PHPUnit_TestCase {
- function setUp()
- {
- $this->store = new Tests_Auth_OpenID_MemStore();
- $this->server = new Auth_OpenID_Server($this->store);
- }
-
- function test_associate()
- {
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $request = Auth_OpenID_AssociateRequest::fromQuery(array());
- $response = $this->server->openid_associate($request);
- $this->assertTrue(array_key_exists('assoc_handle',
- $response->fields));
- }
- }
-
- function test_checkAuth()
- {
- $request = new Auth_OpenID_CheckAuthRequest('arrrrrf',
- '0x3999', array());
-
- $response = $this->server->openid_check_authentication($request);
- $this->assertTrue(array_key_exists('is_valid',
- $response->fields));
- }
-}
-
-class Tests_Auth_OpenID_Signatory extends PHPUnit_TestCase {
- function setUp()
- {
- $this->store =& new Tests_Auth_OpenID_MemStore();
- $this->signatory =& new Auth_OpenID_Signatory($this->store);
- $this->dumb_key = $this->signatory->dumb_key;
- $this->normal_key = $this->signatory->normal_key;
- }
-
- function test_sign()
- {
- $request = new Auth_OpenID_ServerRequest();
- $assoc_handle = '{assoc}{lookatme}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(60, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
- $this->store->storeAssociation($this->normal_key, $assoc);
- $request->assoc_handle = $assoc_handle;
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array(
- 'foo' => 'amsigned',
- 'bar' => 'notsigned',
- 'azu' => 'alsosigned');
-
- $response->signed = array('foo', 'azu');
- $sresponse = $this->signatory->sign($response);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields,
- 'assoc_handle'),
- $assoc_handle);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields, 'signed'),
- 'foo,azu');
-
- $this->assertTrue(Auth_OpenID::arrayGet($sresponse->fields, 'sig'));
- }
-
- function test_signDumb()
- {
- $request = new Auth_OpenID_ServerRequest();
- $request->assoc_handle = null;
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array(
- 'foo' => 'amsigned',
- 'bar' => 'notsigned',
- 'azu' => 'alsosigned');
-
- $response->signed = array('foo', 'azu');
- $sresponse = $this->signatory->sign($response);
-
- $assoc_handle = Auth_OpenID::arrayGet($sresponse->fields,
- 'assoc_handle');
-
- $this->assertTrue($assoc_handle);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
-
- $this->assertTrue($assoc);
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields, 'signed'),
- 'foo,azu');
- $this->assertTrue(Auth_OpenID::arrayGet($sresponse->fields, 'sig'));
- }
-
- function test_signExpired()
- {
- $request = new Auth_OpenID_ServerRequest();
- $assoc_handle = '{assoc}{lookatme}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(-10, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
- $this->store->storeAssociation($this->normal_key, $assoc);
- $this->assertTrue($this->store->getAssociation($this->normal_key,
- $assoc_handle));
-
- $request->assoc_handle = $assoc_handle;
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array(
- 'foo' => 'amsigned',
- 'bar' => 'notsigned',
- 'azu' => 'alsosigned');
-
- $response->signed = array('foo', 'azu');
- $sresponse = $this->signatory->sign($response);
-
- $new_assoc_handle = Auth_OpenID::arrayGet($sresponse->fields,
- 'assoc_handle');
- $this->assertTrue($new_assoc_handle);
- $this->assertFalse($new_assoc_handle == $assoc_handle);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields,
- 'invalidate_handle'),
- $assoc_handle);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields, 'signed'),
- 'foo,azu');
- $this->assertTrue(Auth_OpenID::arrayGet($sresponse->fields, 'sig'));
-
- // make sure the expired association is gone
- $this->assertFalse($this->store->getAssociation($this->normal_key,
- $assoc_handle));
-
- // make sure the new key is a dumb mode association
- $this->assertTrue($this->store->getAssociation($this->dumb_key,
- $new_assoc_handle));
-
- $this->assertFalse($this->store->getAssociation($this->normal_key,
- $new_assoc_handle));
- }
-
- function test_signInvalidHandle()
- {
- $request = new Auth_OpenID_ServerRequest();
- $assoc_handle = '{bogus-assoc}{notvalid}';
-
- $request->assoc_handle = $assoc_handle;
- $response = new Auth_OpenID_CheckIDResponse($request);
- $response->fields = array(
- 'foo' => 'amsigned',
- 'bar' => 'notsigned',
- 'azu' => 'alsosigned');
-
- $response->signed = array('foo', 'azu');
- $sresponse = $this->signatory->sign($response);
-
- $new_assoc_handle = Auth_OpenID::arrayGet($sresponse->fields,
- 'assoc_handle');
-
- $this->assertTrue($new_assoc_handle);
- $this->assertFalse($new_assoc_handle == $assoc_handle);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields,
- 'invalidate_handle'),
- $assoc_handle);
-
- $this->assertEquals(Auth_OpenID::arrayGet($sresponse->fields, 'signed'),
- 'foo,azu');
- $this->assertTrue(Auth_OpenID::arrayGet($sresponse->fields, 'sig'));
-
- // make sure the new key is a dumb mode association
- $this->assertTrue($this->store->getAssociation($this->dumb_key,
- $new_assoc_handle));
-
- $this->assertFalse($this->store->getAssociation($this->normal_key,
- $new_assoc_handle));
- }
-
- function test_verify()
- {
- $assoc_handle = '{vroom}{zoom}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(60, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
-
- $this->store->storeAssociation($this->dumb_key, $assoc);
-
- $signed_pairs = array(array('foo', 'bar'),
- array('apple', 'orange'));
-
- $sig = "Ylu0KcIR7PvNegB/K41KpnRgJl0=";
- $verified = $this->signatory->verify($assoc_handle, $sig,
- $signed_pairs);
- $this->assertTrue($verified);
- }
-
- function test_verifyBadSig()
- {
- $assoc_handle = '{vroom}{zoom}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(60, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
-
- $this->store->storeAssociation($this->dumb_key, $assoc);
-
- $signed_pairs = array(array('foo', 'bar'),
- array('apple', 'orange'));
-
- $sig = str_rot13("Ylu0KcIR7PvNegB/K41KpnRgJl0=");
- $verified = $this->signatory->verify($assoc_handle, $sig,
- $signed_pairs);
-
- $this->assertFalse($verified);
- }
-
- function test_verifyBadHandle()
- {
- $assoc_handle = '{vroom}{zoom}';
- $signed_pairs = array(array('foo', 'bar'),
- array('apple', 'orange'));
-
- $sig = "Ylu0KcIR7PvNegB/K41KpnRgJl0=";
- $verified = $this->signatory->verify($assoc_handle, $sig,
- $signed_pairs);
- $this->assertFalse($verified);
- }
-
- function test_getAssoc()
- {
- $assoc_handle = $this->makeAssoc(true);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
- $this->assertTrue($assoc);
- $this->assertEquals($assoc->handle, $assoc_handle);
- }
-
- function test_getAssocExpired()
- {
- $assoc_handle = $this->makeAssoc(true, -10);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
- $this->assertFalse($assoc);
- }
-
- function test_getAssocInvalid()
- {
- $ah = 'no-such-handle';
- $this->assertEquals(
- $this->signatory->getAssociation($ah, false), null);
- }
-
- function test_getAssocDumbVsNormal()
- {
- $assoc_handle = $this->makeAssoc(true);
- $this->assertEquals(
- $this->signatory->getAssociation($assoc_handle, false), null);
- }
-
- function test_createAssociation()
- {
- $assoc = $this->signatory->createAssociation(false);
- $this->assertTrue($this->signatory->getAssociation($assoc->handle,
- false));
- }
-
- function makeAssoc($dumb, $lifetime = 60)
- {
- $assoc_handle = '{bling}';
- $assoc = Auth_OpenID_Association::fromExpiresIn(
- $lifetime, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
-
- $this->store->storeAssociation((($dumb) ? $this->dumb_key :
- $this->normal_key), $assoc);
- return $assoc_handle;
- }
-
- function test_invalidate()
- {
- $assoc_handle = '-squash-';
- $assoc = Auth_OpenID_Association::fromExpiresIn(60, $assoc_handle,
- 'sekrit', 'HMAC-SHA1');
-
- $this->store->storeAssociation($this->dumb_key, $assoc);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
- $this->assertTrue($assoc);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
- $this->assertTrue($assoc);
- $this->signatory->invalidate($assoc_handle, true);
- $assoc = $this->signatory->getAssociation($assoc_handle, true);
- $this->assertFalse($assoc);
- }
-}
-
-class Tests_Auth_OpenID_Server extends PHPUnit_TestSuite {
-
- function getName()
- {
- return "Tests_Auth_OpenID_Server";
- }
-
- function Tests_Auth_OpenID_Server()
- {
- $this->addTestSuite('Tests_Auth_OpenID_Signatory');
- $this->addTestSuite('Tests_Auth_OpenID_ServerTest');
- if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) {
- $this->addTestSuite('Tests_Auth_OpenID_Associate');
- }
- $this->addTestSuite('Tests_Auth_OpenID_CheckAuth');
- $this->addTestSuite('Tests_Auth_OpenID_CheckIDExtension');
- $this->addTestSuite('Tests_Auth_OpenID_CheckAuth');
- $this->addTestSuite('Tests_Auth_OpenID_SigningEncode');
- $this->addTestSuite('Tests_Auth_OpenID_Test_Encode');
- $this->addTestSuite('Tests_Auth_OpenID_Test_Decode');
- $this->addTestSuite('Tests_Auth_OpenID_Test_ServerError');
- $this->addTestSuite('Tests_Auth_OpenID_CheckID');
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/StoreTest.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/StoreTest.php
deleted file mode 100644
index 3943c8f1e..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/StoreTest.php
+++ /dev/null
@@ -1,574 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-/**
- * Require classes and functions to run the Store tests.
- */
-require_once 'Auth/OpenID/Association.php';
-require_once 'Auth/OpenID/CryptUtil.php';
-require_once 'Auth/OpenID.php';
-require_once 'PHPUnit.php';
-
-function _Auth_OpenID_mkdtemp()
-{
- if (strpos(PHP_OS, 'WIN') === 0) {
- $dir = $_ENV['TMP'];
- if (!isset($dir)) {
- $dir = 'C:\Windows\Temp';
- }
- } else {
- $dir = @$_ENV['TMPDIR'];
- if (!isset($dir)) {
- $dir = '/tmp';
- }
- }
-
- return Auth_OpenID_FileStore::_mkdtemp($dir);
-}
-
-
-/**
- * This is the host where the SQL stores' databases should be created
- * and destroyed.
- */
-$_Auth_OpenID_db_test_host = 'dbtest';
-
-/**
- * Generate a sufficently unique database name so many hosts can run
- * SQL store tests on the server at the same time and not step on each
- * other.
- */
-function _Auth_OpenID_getTmpDbName()
-{
- $hostname = php_uname('n');
- $hostname = strtolower(str_replace('.', '_', $hostname));
-
- return sprintf("%s_%d_%s_openid_test",
- $hostname,
- getmypid(),
- strval(rand(1, time())));
-}
-
-/**
- * Tests the OpenID stores.
- *
- * @package OpenID
- */
-class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase {
-
- /**
- * Prepares for the SQL store tests.
- */
- function setUp()
- {
- $this->letters = Auth_OpenID_letters;
- $this->digits = Auth_OpenID_digits;
- $this->punct = Auth_OpenID_punct;
- $this->allowed_nonce = $this->letters . $this->digits;
- $this->allowed_handle = $this->letters . $this->digits . $this->punct;
- }
-
- /**
- * Generates a nonce value.
- */
- function generateNonce()
- {
- return Auth_OpenID_CryptUtil::randomString(8, $this->allowed_nonce);
- }
-
- /**
- * Generates an association with the specified parameters.
- */
- function genAssoc($now, $issued = 0, $lifetime = 600)
- {
- $sec = Auth_OpenID_CryptUtil::randomString(20);
- $hdl = Auth_OpenID_CryptUtil::randomString(128, $this->allowed_handle);
- return new Auth_OpenID_Association($hdl, $sec, $now + $issued,
- $lifetime, 'HMAC-SHA1');
- }
-
- /**
- * @access private
- */
- function _checkRetrieve(&$store, $url, $handle, $expected, $name = null)
- {
- $retrieved_assoc = $store->getAssociation($url, $handle);
- if (($expected === null) || ($store->isDumb())) {
- $this->assertNull($retrieved_assoc, "Retrieved association " .
- "was non-null");
- } else {
- if ($retrieved_assoc === null) {
- $this->fail("$name: Got null when expecting " .
- $expected->serialize());
- } else {
- $this->assertEquals($expected->serialize(),
- $retrieved_assoc->serialize(), $name);
- }
- }
- }
-
- function _checkRemove(&$store, $url, $handle, $expected, $name = null)
- {
- $present = $store->removeAssociation($url, $handle);
- $expectedPresent = (!$store->isDumb() && $expected);
- $this->assertTrue((!$expectedPresent && !$present) ||
- ($expectedPresent && $present),
- $name);
- }
-
- /**
- * Make sure a given store has a minimum of API compliance. Call
- * this function with an empty store.
- *
- * Raises AssertionError if the store does not work as expected.
- *
- * OpenIDStore -> NoneType
- */
- function _testStore($store)
- {
-
- // Association functions
- $now = time();
-
- $server_url = 'http://www.myopenid.com/openid';
-
- $assoc = $this->genAssoc($now);
-
- $this->_checkRetrieve($store, $server_url, null, null,
- 'Make sure that a missing association returns no result');
-
- $store->storeAssociation($server_url, $assoc);
- $this->_checkRetrieve($store, $server_url, null, $assoc,
- 'Check that after storage, getting returns the same result');
-
- $this->_checkRetrieve($store, $server_url, null, $assoc,
- 'more than once');
-
- $store->storeAssociation($server_url, $assoc);
- $this->_checkRetrieve($store, $server_url, null, $assoc,
- 'Storing more than once has no ill effect');
-
- // Removing an association that does not exist returns not present
- $this->_checkRemove($store, $server_url, $assoc->handle . 'x', false,
- "Remove nonexistent association (1)");
-
- // Removing an association that does not exist returns not present
- $this->_checkRemove($store, $server_url . 'x', $assoc->handle, false,
- "Remove nonexistent association (2)");
-
- // Removing an association that is present returns present
- $this->_checkRemove($store, $server_url, $assoc->handle, true,
- "Remove existent association");
-
- // but not present on subsequent calls
- $this->_checkRemove($store, $server_url, $assoc->handle, false,
- "Remove nonexistent association after removal");
-
- // Put assoc back in the store
- $store->storeAssociation($server_url, $assoc);
-
- // More recent and expires after assoc
- $assoc2 = $this->genAssoc($now, $issued = 1);
- $store->storeAssociation($server_url, $assoc2);
-
- $this->_checkRetrieve($store, $server_url, null, $assoc2,
- 'After storing an association with a different handle, but the
-same $server_url, the handle with the later expiration is
-returned.');
-
- $this->_checkRetrieve($store, $server_url, $assoc->handle, $assoc,
- 'We can still retrieve the older association');
-
- $this->_checkRetrieve($store, $server_url, $assoc2->handle, $assoc2,
- 'Plus we can retrieve the association with the later expiration
-explicitly');
-
- $assoc3 = $this->genAssoc($now, $issued = 2, $lifetime = 100);
- $store->storeAssociation($server_url, $assoc3);
-
- // More recent issued time, so assoc3 is expected.
- $this->_checkRetrieve($store, $server_url, null, $assoc3, "(1)");
-
- $this->_checkRetrieve($store, $server_url, $assoc->handle,
- $assoc, "(2)");
-
- $this->_checkRetrieve($store, $server_url, $assoc2->handle,
- $assoc2, "(3)");
-
- $this->_checkRetrieve($store, $server_url, $assoc3->handle,
- $assoc3, "(4)");
-
- $this->_checkRemove($store, $server_url, $assoc2->handle, true, "(5)");
-
- $this->_checkRetrieve($store, $server_url, null, $assoc3, "(6)");
-
- $this->_checkRetrieve($store, $server_url, $assoc->handle,
- $assoc, "(7)");
-
- $this->_checkRetrieve($store, $server_url, $assoc2->handle,
- null, "(8)");
-
- $this->_checkRetrieve($store, $server_url, $assoc3->handle,
- $assoc3, "(9)");
-
- $this->_checkRemove($store, $server_url, $assoc2->handle,
- false, "(10)");
-
- $this->_checkRemove($store, $server_url, $assoc3->handle,
- true, "(11)");
-
- $this->_checkRetrieve($store, $server_url, null, $assoc, "(12)");
-
- $this->_checkRetrieve($store, $server_url, $assoc->handle,
- $assoc, "(13)");
-
- $this->_checkRetrieve($store, $server_url, $assoc2->handle,
- null, "(14)");
-
- $this->_checkRetrieve($store, $server_url, $assoc3->handle,
- null, "(15)");
-
- $this->_checkRemove($store, $server_url, $assoc2->handle,
- false, "(16)");
-
- $this->_checkRemove($store, $server_url, $assoc->handle,
- true, "(17)");
-
- $this->_checkRemove($store, $server_url, $assoc3->handle,
- false, "(18)");
-
- $this->_checkRetrieve($store, $server_url, null, null, "(19)");
-
- $this->_checkRetrieve($store, $server_url, $assoc->handle,
- null, "(20)");
-
- $this->_checkRetrieve($store, $server_url, $assoc2->handle,
- null, "(21)");
-
- $this->_checkRetrieve($store, $server_url,$assoc3->handle,
- null, "(22)");
-
- $this->_checkRemove($store, $server_url, $assoc2->handle,
- false, "(23)");
-
- $this->_checkRemove($store, $server_url, $assoc->handle,
- false, "(24)");
-
- $this->_checkRemove($store, $server_url, $assoc3->handle,
- false, "(25)");
-
- // Put associations into store, for two different server URLs
- $assoc1 = $this->genAssoc($now);
- $assoc2 = $this->genAssoc($now + 2);
- $server_url1 = "http://one.example.com/one";
- $server_url2 = "http://two.localhost.localdomain/two";
-
- $store->storeAssociation($server_url1, $assoc1);
- $store->storeAssociation($server_url2, $assoc2);
-
- // Ask for each one, make sure we get it
- $this->_checkRetrieve($store, $server_url1, $assoc1->handle,
- $assoc1, "(26)");
-
- $this->_checkRetrieve($store, $server_url2, $assoc2->handle,
- $assoc2, "(27)");
-
- $store->storeAssociation($server_url1, $assoc1);
- $store->storeAssociation($server_url2, $assoc2);
-
- // Ask for each one, make sure we get it
- $this->_checkRetrieve($store, $server_url1, null,
- $assoc1, "(28)");
-
- $this->_checkRetrieve($store, $server_url2, null,
- $assoc2, "(29)");
- }
-
- function _checkUseNonce(&$store, $nonce, $expected, $msg=null)
- {
- $actual = $store->useNonce($nonce);
- $expected = $store->isDumb() || $expected;
- $val = ($actual && $expected) || (!$actual && !$expected);
- $this->assertTrue($val, "_checkUseNonce failed: $msg");
- }
-
- function _testNonce(&$store)
- {
- // Nonce functions
-
- // Random nonce (not in store)
- $nonce1 = $this->generateNonce();
-
- // A nonce is not present by default
- $this->_checkUseNonce($store, $nonce1, false, 1);
-
- // Storing once causes useNonce to return true the first, and
- // only the first, time it is called after the $store->
- $store->storeNonce($nonce1);
- $this->_checkUseNonce($store, $nonce1, true, 2);
- $this->_checkUseNonce($store, $nonce1, false, 3);
- $this->_checkUseNonce($store, $nonce1, false, 4);
-
- // Storing twice has the same effect as storing once.
- $store->storeNonce($nonce1);
- $store->storeNonce($nonce1);
- $this->_checkUseNonce($store, $nonce1, true, 5);
- $this->_checkUseNonce($store, $nonce1, false, 6);
- $this->_checkUseNonce($store, $nonce1, false, 7);
-
- // Auth key functions
-
- // There is no key to start with, so generate a new key and
- // return it.
- $key = $store->getAuthKey();
-
- // The second time around should return the same as last time.
- $key2 = $store->getAuthKey();
- $this->assertEquals($key, $key2, "Auth keys differ");
- $this->assertEquals(strlen($key), $store->AUTH_KEY_LEN,
- "Key length not equals AUTH_KEY_LEN");
- }
-
- function test_memstore()
- {
- require_once 'Tests/Auth/OpenID/MemStore.php';
- $store = new Tests_Auth_OpenID_MemStore('Bogus auth key ');
- $this->_testStore(&$store);
- $this->_testNonce(&$store);
- }
-
- function test_filestore()
- {
- require_once 'Auth/OpenID/FileStore.php';
-
- $temp_dir = _Auth_OpenID_mkdtemp();
-
- if (!$temp_dir) {
- trigger_error('Could not create temporary directory ' .
- 'with Auth_OpenID_FileStore::_mkdtemp',
- E_USER_WARNING);
- return null;
- }
-
- $store = new Auth_OpenID_FileStore($temp_dir);
- $this->_testStore($store);
- $this->_testNonce($store);
- $store->destroy();
- }
-
- function test_postgresqlstore()
- {
- // If the postgres extension isn't loaded or loadable, succeed
- // because we can't run the test.
- if (!(extension_loaded('pgsql') ||
- @dl('pgsql.' . PHP_SHLIB_SUFFIX))) {
- $this->pass();
- return;
- }
-
- require_once 'Auth/OpenID/PostgreSQLStore.php';
- require_once 'DB.php';
-
- global $_Auth_OpenID_db_test_host;
-
- $temp_db_name = _Auth_OpenID_getTmpDbName();
-
- $connect_db_name = 'test_master';
-
- $dsn = array(
- 'phptype' => 'pgsql',
- 'username' => 'openid_test',
- 'password' => '',
- 'hostspec' => $_Auth_OpenID_db_test_host,
- 'database' => $connect_db_name
- );
-
- $allowed_failures = 5;
- $result = null;
- $sleep_time = 1.0;
- $sql = sprintf("CREATE DATABASE %s", $temp_db_name);
-
- for ($failures = 0; $failures < $allowed_failures; $failures++) {
- $template_db =& DB::connect($dsn);
-
- if (PEAR::isError($template_db)) {
- $result &= $template_db;
- } else {
- // Try to create the test database.
- $result = $template_db->query($sql);
-
- $template_db->disconnect();
- unset($template_db);
-
- if (!PEAR::isError($result)) {
- break;
- }
- }
-
- $sleep_time *= ((mt_rand(1, 100) / 100.0) + 1.5);
- print "Failed to create database $temp_db_name.\n".
- "Waiting $sleep_time before trying again\n";
-
- $int_sleep = floor($sleep_time);
- $frac_sleep = $sleep_time - $int_sleep;
- sleep($int_sleep);
- usleep($frac_sleep * 1000000.0);
- }
-
- if ($failures == $allowed_failures) {
- $this->fail("Temporary database creation failed after $failures ".
- " tries ('$temp_db_name'): " . $result->getMessage());
- return;
- }
-
- // Disconnect from template1 and reconnect to the temporary
- // testing database.
- $dsn['database'] = $temp_db_name;
- $db =& DB::connect($dsn);
-
- if (PEAR::isError($db)) {
- $this->fail("Temporary database connection failed " .
- " ('$temp_db_name'): " . $db->getMessage());
- return;
- }
-
- $store =& new Auth_OpenID_PostgreSQLStore($db);
- $store->createTables();
- $this->_testStore($store);
- $this->_testNonce($store);
-
- $db->disconnect();
- unset($db);
-
- // Connect to template1 again so we can drop the temporary
- // database.
- $dsn['database'] = $connect_db_name;
- $template_db =& DB::connect($dsn);
-
- if (PEAR::isError($template_db)) {
- $this->fail("Template database connection (to drop " .
- "temporary database) failed: " .
- $template_db->getMessage());
- return;
- }
-
- $result = $template_db->query(sprintf("DROP DATABASE %s",
- $temp_db_name));
-
- if (PEAR::isError($result)) {
- $this->fail("Dropping temporary database failed: " .
- $result->getMessage());
- return;
- }
-
- $template_db->disconnect();
- unset($template_db);
- }
-
- function test_sqlitestore()
- {
- // If the postgres extension isn't loaded or loadable, succeed
- // because we can't run the test.
- if (!(extension_loaded('sqlite') ||
- @dl('sqlite.' . PHP_SHLIB_SUFFIX))) {
- $this->pass();
- return;
- }
-
- require_once 'Auth/OpenID/SQLiteStore.php';
- require_once 'DB.php';
-
- $temp_dir = _Auth_OpenID_mkdtemp();
-
- if (!$temp_dir) {
- trigger_error('Could not create temporary directory ' .
- 'with Auth_OpenID_FileStore::_mkdtemp',
- E_USER_WARNING);
- return null;
- }
-
- $dsn = sprintf("sqlite:///%s/file.db", $temp_dir);
- $db =& DB::connect($dsn);
-
- if (PEAR::isError($db)) {
- $this->fail("SQLite database connection failed: " .
- $db->getMessage());
- } else {
- $store =& new Auth_OpenID_SQLiteStore($db);
- $this->assertTrue($store->createTables(), "Table creation failed");
- $this->_testStore($store);
- $this->_testNonce($store);
- }
-
- $db->disconnect();
- unset($db);
- unset($store);
- unlink($temp_dir . '/file.db');
- rmdir($temp_dir);
- }
-
- function test_mysqlstore()
- {
- // If the mysql extension isn't loaded or loadable, succeed
- // because we can't run the test.
- if (!(extension_loaded('mysql') ||
- @dl('mysql.' . PHP_SHLIB_SUFFIX))) {
- $this->pass();
- return;
- }
-
- require_once 'Auth/OpenID/MySQLStore.php';
- require_once 'DB.php';
-
- global $_Auth_OpenID_db_test_host;
-
- $dsn = array(
- 'phptype' => 'mysql',
- 'username' => 'openid_test',
- 'password' => '',
- 'hostspec' => $_Auth_OpenID_db_test_host
- );
-
- $db =& DB::connect($dsn);
-
- if (PEAR::isError($db)) {
- print "MySQL database connection failed: " .
- $db->getMessage();
- $this->pass();
- return;
- }
-
- $temp_db_name = _Auth_OpenID_getTmpDbName();
-
- $result = $db->query("CREATE DATABASE $temp_db_name");
-
- if (PEAR::isError($result)) {
- $this->fail("Error creating MySQL temporary database: " .
- $result->getMessage());
- return;
- }
-
- $db->query("USE $temp_db_name");
-
- $store =& new Auth_OpenID_MySQLStore($db);
- $store->createTables();
- $this->_testStore($store);
- $this->_testNonce($store);
-
- $db->query("DROP DATABASE $temp_db_name");
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/TestUtil.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/TestUtil.php
deleted file mode 100644
index 83581600d..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/TestUtil.php
+++ /dev/null
@@ -1,28 +0,0 @@
-setName($desc);
- $this->case = $case;
- $this->expected = $expected;
- }
-
- function runTest()
- {
- $is_sane = Auth_OpenID_TrustRoot::isSane($this->case);
- $parsed = (bool)Auth_OpenID_TrustRoot::_parse($this->case);
- switch ($this->expected) {
- case 'sane':
- $this->assertTrue($is_sane);
- $this->assertTrue($parsed);
- break;
- case 'insane':
- $this->assertTrue($parsed);
- $this->assertFalse($is_sane);
- break;
- default:
- $this->assertFalse($parsed);
- $this->assertFalse($is_sane);
- }
- }
-}
-
-class Tests_Auth_OpenID_TRMatchCase extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_TRMatchCase($desc, $tr, $rt, $matches)
- {
- $this->setName($desc);
- $this->tr = $tr;
- $this->rt = $rt;
- $this->matches = $matches;
- }
-
- function runTest()
- {
- $matches = Auth_OpenID_TrustRoot::match($this->tr, $this->rt);
- $this->assertEquals((bool)$this->matches, (bool)$matches);
- }
-}
-
-function Tests_Auth_OpenID_parseHeadings($data, $c)
-{
- $heading_pat = '/(^|\n)' . $c . '{40}\n([^\n]+)\n' . $c . '{40}\n()/';
- $offset = 0;
- $headings = array();
- while (true) {
- preg_match($heading_pat, substr($data, $offset), $matches,
- PREG_OFFSET_CAPTURE);
- if (!$matches) {
- break;
- }
- $start = $matches[0][1];
- $heading = $matches[2][0];
- $end = $matches[3][1];
- $headings[] = array('heading' => $heading,
- 'start' => $offset + $start,
- 'end' => $offset + $end,
- );
- $offset += $end;
- }
- return $headings;
-}
-
-function Tests_Auth_OpenID_getSections($data)
-{
- $headings = Tests_Auth_OpenID_parseHeadings($data, '-');
- $sections = array();
- $n = count($headings);
- for ($i = 0; $i < $n; ) {
- $secdata = $headings[$i];
- list($numtests, $desc) = explode(': ', $secdata['heading']);
- $start = $secdata['end'];
- $i += 1;
- if ($i < $n) {
- $blob = substr($data, $start, $headings[$i]['start'] - $start);
- } else {
- $blob = substr($data, $start);
- }
- $lines = explode("\n", trim($blob));
- if (count($lines) != $numtests) {
- trigger_error('Parse failure: ' . var_export($secdata, true),
- E_USER_ERROR);
- }
- $sections[] = array('desc' => $desc, 'lines' => $lines,);
- }
- return $sections;
-}
-
-function Tests_Auth_OpenID_trParseTests($head, $tests)
-{
- $tests = array('fail' => $tests[0],
- 'insane' => $tests[1],
- 'sane' => $tests[2]);
- $testobjs = array();
- foreach ($tests as $expected => $testdata) {
- $lines = $testdata['lines'];
- foreach ($lines as $line) {
- $desc = sprintf("%s - %s: %s", $head,
- $testdata['desc'], var_export($line, true));
- $testobjs[] = new Tests_Auth_OpenID_TRParseCase(
- $desc, $line, $expected);
- }
- }
- return $testobjs;
-}
-
-function Tests_Auth_OpenID_trMatchTests($head, $tests)
-{
- $tests = array(true => $tests[0], false => $tests[1]);
- $testobjs = array();
- foreach ($tests as $expected => $testdata) {
- $lines = $testdata['lines'];
- foreach ($lines as $line) {
- $pat = '/^([^ ]+) +([^ ]+)$/';
- preg_match($pat, $line, $matches);
- list($_, $tr, $rt) = $matches;
- $desc = sprintf("%s - %s: %s %s", $head, $testdata['desc'],
- var_export($tr, true), var_export($rt, true));
- $testobjs[] = new Tests_Auth_OpenID_TRMatchCase(
- $desc, $tr, $rt, $expected);
- }
- }
- return $testobjs;
-}
-
-function Tests_Auth_OpenID_trustRootTests()
-{
- $data = Tests_Auth_OpenID_readdata('trustroot.txt');
- list($parsehead, $matchhead) = Tests_Auth_OpenID_parseHeadings($data, '=');
- $pe = $parsehead['end'];
- $parsedata = substr($data, $pe, $matchhead['start'] - $pe);
- $parsetests = Tests_Auth_OpenID_getSections($parsedata);
- $parsecases = Tests_Auth_OpenID_trParseTests($parsehead['heading'],
- $parsetests);
-
- $matchdata = substr($data, $matchhead['end']);
- $matchtests = Tests_Auth_OpenID_getSections($matchdata);
- $matchcases = Tests_Auth_OpenID_trMatchTests($matchhead['heading'],
- $matchtests);
-
- return array_merge($parsecases, $matchcases);
-}
-
-class Tests_Auth_OpenID_TrustRoot extends PHPUnit_TestSuite {
- function Tests_Auth_OpenID_TrustRoot($name)
- {
- $this->setName($name);
-
- foreach (Tests_Auth_OpenID_trustRootTests() as $test) {
- $this->addTest($test);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/URINorm.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/URINorm.php
deleted file mode 100644
index 02263af33..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/URINorm.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID/URINorm.php';
-require_once 'Tests/Auth/OpenID/TestUtil.php';
-
-class Tests_Auth_OpenID_URINorm_TestCase extends PHPUnit_TestCase {
- function Tests_Auth_OpenID_URINorm_TestCase(
- $name, $uri, $expected)
- {
-
- $this->setName($name);
- $this->uri = $uri;
- $this->expected = $expected;
- }
-
- function runTest()
- {
- $actual = Auth_OpenID_urinorm($this->uri);
- $this->assertEquals($this->expected, $actual);
- }
-}
-
-class Tests_Auth_OpenID_URINorm extends PHPUnit_TestSuite {
- function _readTestCases()
- {
- $lines = Tests_Auth_OpenID_readlines('urinorm.txt');
- $cases = array();
- $case = array();
- for ($i = 0; $i < count($lines) && ($i + 3 <= count($lines)); $i += 4) {
- $name = trim($lines[$i]);
- $uri = trim($lines[$i + 1]);
- $expected = trim($lines[$i + 2]);
- if ($expected == 'fail') {
- $expected = null;
- }
- $cases[] = array($name, $uri, $expected);
- }
-
- return $cases;
- }
-
- function Tests_Auth_OpenID_URINorm($name)
- {
- $this->setName($name);
- $cases = $this->_readTestCases();
- foreach ($cases as $case) {
- list($name, $uri, $expected) = $case;
- $this->addTest(new Tests_Auth_OpenID_URINorm_TestCase($name, $uri, $expected));
- }
- }
-}
-
-?>
\ No newline at end of file
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Util.php b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Util.php
deleted file mode 100644
index 838a5a6eb..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/Util.php
+++ /dev/null
@@ -1,260 +0,0 @@
-
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-require_once 'PHPUnit.php';
-require_once 'Auth/OpenID.php';
-
-class Tests_Auth_OpenID_Util extends PHPUnit_TestCase {
- function test_base64()
- {
- // This is not good for international use, but PHP doesn't
- // appear to provide access to the local alphabet.
- $letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
- $digits = "0123456789";
- $extra = "+/=";
- $allowed_s = $letters . $digits . $extra;
- $allowed_d = array();
-
- for ($i = 0; $i < strlen($allowed_s); $i++) {
- $c = $allowed_s[$i];
- $allowed_d[$c] = null;
- }
-
- function checkEncoded($obj, $str, $allowed_array)
- {
- for ($i = 0; $i < strlen($str); $i++) {
- $obj->assertTrue(array_key_exists($str[$i],
- $allowed_array));
- }
- }
-
- $cases = array(
- "",
- "x",
- "\x00",
- "\x01",
- str_repeat("\x00", 100),
- implode("", array_map('chr', range(0, 255)))
- );
-
- foreach ($cases as $s) {
- $b64 = base64_encode($s);
- checkEncoded($this, $b64, $allowed_d);
- $s_prime = base64_decode($b64);
- $this->assertEquals($s_prime, $s);
- }
-
- function random_ordinal($unused)
- {
- return rand(0, 255);
- }
-
- // Randomized test
- foreach (range(0, 49) as $i) {
- $n = rand(0, 2048);
- $s = implode("", array_map('chr',
- array_map('random_ordinal',
- range(0, $n))));
- $b64 = base64_encode($s);
- checkEncoded($this, $b64, $allowed_d);
- $s_prime = base64_decode($b64);
- $this->assertEquals($s_prime, $s);
- }
- }
-
- function test_normalizeUrl()
- {
- $this->assertEquals("http://foo.com/",
- Auth_OpenID::normalizeUrl("foo.com"));
-
- $this->assertEquals("http://foo.com/",
- Auth_OpenID::normalizeUrl("http://foo.com"));
-
- $this->assertEquals("https://foo.com/",
- Auth_OpenID::normalizeUrl("https://foo.com"));
-
- $this->assertEquals("http://foo.com/bar",
- Auth_OpenID::normalizeUrl("foo.com/bar"));
-
- $this->assertEquals("http://foo.com/bar",
- Auth_OpenID::normalizeUrl("http://foo.com/bar"));
-
- $this->assertEquals("http://foo.com/",
- Auth_OpenID::normalizeUrl("http://foo.com/"));
-
- $this->assertEquals("https://foo.com/",
- Auth_OpenID::normalizeUrl("https://foo.com/"));
-
- $this->assertEquals("https://foo.com/bar" ,
- Auth_OpenID::normalizeUrl("https://foo.com/bar"));
-
- if (0) {
- $this->assertEquals("http://foo.com/%E8%8D%89",
- Auth_OpenID::normalizeUrl("foo.com/\u8349"));
-
- $this->assertEquals("http://foo.com/%E8%8D%89",
- Auth_OpenID::normalizeUrl("http://foo.com/\u8349"));
- }
-
- $non_ascii_domain_cases = array(
- array("http://xn--vl1a.com/",
- "\u8349.com"),
-
- array("http://xn--vl1a.com/",
- "http://\u8349.com"),
-
- array("http://xn--vl1a.com/",
- "\u8349.com/"),
-
- array("http://xn--vl1a.com/",
- "http://\u8349.com/"),
-
- array("http://xn--vl1a.com/%E8%8D%89",
- "\u8349.com/\u8349"),
-
- array("http://xn--vl1a.com/%E8%8D%89",
- "http://\u8349.com/\u8349"),
- );
-
- // XXX
- /*
- codecs.getencoder('idna')
- except LookupError:
- # If there is no idna codec, these cases with
- # non-ascii-representable domain names should fail.
- should_raise = True
- else:
- should_raise = False
-
- for expected, case in non_ascii_domain_cases:
-try:
-actual = Auth_OpenID::normalizeUrl(case)
- except UnicodeError:
- assert should_raise
- else:
-assert not should_raise and actual == expected, case
- */
-
- $this->assertNull(Auth_OpenID::normalizeUrl(null));
- $this->assertNull(Auth_OpenID::normalizeUrl(''));
- $this->assertNull(Auth_OpenID::normalizeUrl('http://'));
- }
-
- function test_appendArgs()
- {
-
- $simple = 'http://www.example.com/';
-
- $cases = array(
- array('empty list',
- array($simple, array()),
- $simple),
-
- array('empty dict',
- array($simple, array()),
- $simple),
-
- array('one list',
- array($simple, array(array('a', 'b'))),
- $simple . '?a=b'),
-
- array('one dict',
- array($simple, array('a' => 'b')),
- $simple . '?a=b'),
-
- array('two list (same)',
- array($simple, array(array('a', 'b'),
- array('a', 'c'))),
- $simple . '?a=b&a=c'),
-
- array('two list',
- array($simple, array(array('a', 'b'),
- array('b', 'c'))),
- $simple . '?a=b&b=c'),
-
- array('two list (order)',
- array($simple, array(array('b', 'c'),
- array('a', 'b'))),
- $simple . '?b=c&a=b'),
-
- array('two dict (order)',
- array($simple, array('b' => 'c',
- 'a' => 'b')),
- $simple . '?a=b&b=c'),
-
- array('escape',
- array($simple, array(array('=', '='))),
- $simple . '?%3D=%3D'),
-
- array('escape (URL)',
- array($simple, array(array('this_url',
- $simple))),
- $simple .
- '?this_url=http%3A%2F%2Fwww.example.com%2F'),
-
- array('use dots',
- array($simple, array(array('openid.stuff',
- 'bother'))),
- $simple . '?openid.stuff=bother'),
-
- array('args exist (empty)',
- array($simple . '?stuff=bother', array()),
- $simple . '?stuff=bother'),
-
- array('args exist',
- array($simple . '?stuff=bother',
- array(array('ack', 'ack'))),
- $simple . '?stuff=bother&ack=ack'),
-
- array('args exist',
- array($simple . '?stuff=bother',
- array(array('ack', 'ack'))),
- $simple . '?stuff=bother&ack=ack'),
-
- array('args exist (dict)',
- array($simple . '?stuff=bother',
- array('ack' => 'ack')),
- $simple . '?stuff=bother&ack=ack'),
-
- array('args exist (dict 2)',
- array($simple . '?stuff=bother',
- array('ack' => 'ack', 'zebra' => 'lion')),
- $simple . '?stuff=bother&ack=ack&zebra=lion'),
-
- array('three args (dict)',
- array($simple, array('stuff' => 'bother',
- 'ack' => 'ack',
- 'zebra' => 'lion')),
- $simple . '?ack=ack&stuff=bother&zebra=lion'),
-
- array('three args (list)',
- array($simple, array(
- array('stuff', 'bother'),
- array('ack', 'ack'),
- array('zebra', 'lion'))),
- $simple . '?stuff=bother&ack=ack&zebra=lion'),
- );
-
- // Tests.
- foreach ($cases as $case) {
- list($desc, $data, $expected) = $case;
- list($url, $query) = $data;
- $this->assertEquals($expected,
- Auth_OpenID::appendArgs($url, $query));
- }
- }
-}
-
-?>
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhexch b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhexch
deleted file mode 100644
index 7a8be0737..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhexch
+++ /dev/null
@@ -1,25 +0,0 @@
-2126517416 1503105722 107994742031567165457540274858809652167995244913839787589743578103625285208352685332617657612917013907706708046204110421143061814711041523408378123857885283119340960531860106377561159933747570456852792031929014142490977574671361334052940195520731561436107832724927338342871107723160776334443535305873323500256
-1726325708 97982531 120276049194830643562108817809662062106546923236483207874835831104433621725428405166395533625121884325430201809382464614237831903082554679507511419420917850293136497504021313018779166242697363853538302653639224106865664333535348491338293646599577557630201300627170167862878616413985927131488374258664616392092
-7191572 1822336109 122056637146069839485450157659463602136773435897258591538866604089577736061707581662949502933519623787237101424065925246227311788026398025228549571401681364284397681558495127293422405005519207011429758784679359026564663723906503072635741603815702201571462971153413211041068663899032199555395016545688330586044
-228786056 1675584603 117701151389970889003978379762267752133865163176557074701079147801046451813688145274964215828365957142552336288689654120601548113748929766366564174096775189852190965077394508456052823068488823291767811224538103381867631753777200820579564678159674117155563703553000884461777658090456283332220216734612556688513
-804908984 2135801843 64993745755656098807721600357147815184322152457013249228399624894951891365784451431980303960531348451816046446458097670030866575746640795583720668211568084611960590087205609635406810868042628237527172170079769791670793545166757565720288711565725471066283638538704293790079806106677373567711048953361333211210
-1122280790 1614259350 3970244390792364343312138669070883638127263175075582263096706481850448381703964455173288740017450440943500797144425033043394229962284552755667989452357422108026327690718801740503572676309934059296211509079412739861064178751353597300902277808636740745335474263237517162977595705012834985895341553367459792583
-554314515 998420920 123643361743671701825618173162391028658772950477687990712748798605914570427945055208640384218469111438408345424338893652923941552893606133066783001743721804859308011765507616515353882559991735865794891472781955621601467016660304188272123202130977476560852093272543539966026915472638392018462692756028817601255
-719945347 612820861 103551249110130410018728043034553056272870332237608830696804104933749752848182147616875273399120950956495972830177071656956289995248469136767050516935071277259217339496102844766065836859503647533631994664364053659677674596380230790347281302210808329346735637394258018381272973124437749621859047096780954428763
-1030625109 1519412381 15696617275088442746387785148060623054817901281945029743077460769180096631404983383910114661025034557230747207080210469011273591184527303007260363112037932265980126744700626024259985586947347501172863220738584453809309462129610346067407238209251289710742647393829531889303218223237301268534338307710560528439
-1711254768 1710707291 57671766580359527580383190392835992822988951359063099518333951473557157636791373831886967456320589708220219137556141104065094734173377513568373511612097050435132426608350879787688784646390242899955969071718348216328885834450215105058725433533776719158074043390881257587614495125963197168525883771897032429145
-350065369 319208735 44521456496863698728911963510653524876630475042295240074435222668882607096381437705850621136342821688618111659046306438623837465097724847737566157513351593063095577843263064035230462006868686576892037899378382406468120801597507834123281075093108794208153836881908434178839513489161646768450411118658866064760
-2060218994 1946043223 56312469398022909670236635086334904553302665496424591277087996113064393075310693844995965663947160222486178761741935506327835516277624460430181450292802834360724976701838361338230904004764511115279873515265325364671729600765057941485718305803874368460265173324375012707038078949514720443784809672434739391394
-348859478 486047271 63578529904279717544096579659734885121575283886072626718230632949600891106018451131129915865157675764791879663149288069798959505461654979937263948081560345222746334083402817181164255208790802816536212306902000509334761465449621953806270899950736579351124776383450108496252367170418747525612150563944975123906
-1012847796 1311216437 107243486601777772242638374457577339776317528440551074937135087437181884726459082109032187432358497015564158022857522392034581988349463322793155498885898276448910563934149930379053835676169014345745737841013305105289515557002942278171260275549569040668192618881235525671100756834785472005323827534045854021808
-1108188659 73002956 151810407586486667408500610375120927048683500513617431444670840241105574837701928593342245869128797827409414723271900961746330458448581633550115101600384307415146567797051023727766743006773542272526168313129133103058023736384944187039543948615045687254043611794926502253898300807539332514119558228945387167129
-1367891527 957164137 106888874248390844568539366153235739322099571679913873665077300044384432133087328354115380340807163549209282323027334598550750155549975114208460003069900549945106924101337174939911191001778776920788324219234143471273850920009578258747072782983631129326451246547584416492036977756842649955247390532642313031673
-1109319782 312705549 68015190517529836158634537187194145539209089151286211608940739126031607591236786876471227901028349157506546942329120582174574792522929377067808957872180985535362179866434055727341930725758279092655515659945664689974113139170079360543337269872976473433045950679959300152245802435127006127508284128226462808242
-77629902 1442208847 80002290434058357698705037287975366182731667140415670086832039653095542318592553515737200055739316505804591069679885064388918352070456242079053263046801427045473800954002156858264359891351667747947419377687560365442620710551484084591458509139700723197713694698034159851521977928611736821392017020477832037627
-1876665427 42392232 94638321177007894302596716790742601595610267055803051893624262442254201910985079684859058170169970420428917385076321338591735591117741499259022286688741758915429225227910702796255294628145448897362890044237980198958757175908654342104958253051607028469935368687936664986431151922321609065078691893879183189566
-559635525 1782490275 71365295096950865667427967092027725943054589808884646377867956234326896501650860934260905567087143525158504721587985301638221372965891635800328428504369765880956526297788284176796001565732103141822914955442743632126166019769189834699258461912602048002960149362882398622111007162709444738907309082349930416022
-743575094 32085276 110453584602878746921666429659148701413696049424461554973529870857842263810553552249241246313332783204009612578170167391820378603413812193480492843470042238103670641705732755583940134259794253885826115668806244330875357074130716388274584300227667628005544555311079499447940768673150499033922449576383527638186
-129818206 137481306 140835473021876998102027624369898079740454145360699735493249477450544517213808389172240396819192163023303266715591396745357472463341356969319556862236385556442904650009255138279232984377682804793224148996875324569988553808409865099882747099149617352970774643108291836908871124753511856578160489828404865664010
-570689556 1980693879 108353275894436996626884805554770441694866167783124178905252902978286824751598925059178987939656961896173921225105217325495780672752694383439806863122466053616930970271706866769895033633709670957150865005763659847698663978549871624628298476651867451354816053985969930735100533712902146229305011837945607699037
-2103057616 691067770 27024056452709622585420653808400360576905666723601175215091499609471301967744143329187436673102391151329548614036436716051750524604202541651425479133617399916946398092715923340837394931898418514658066714568415577105694330058750941172815095999450748361179045856199026312487393802486505084466623313733605784416
-481705774 1641440342 117722260864906582664053412535574009960206959347375143271559843536103545468155917636456429488071536410856812908716077868452921005581676036410474437330482920141777150620686622782118823530416466223519936589968714322291361670902315520017103387742935706013660879451297004924070011539277017717095949755265539759012
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhpriv b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhpriv
deleted file mode 100644
index 0fa523146..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/dhpriv
+++ /dev/null
@@ -1,29 +0,0 @@
-130706940119084053627151828062879423433929180135817317038378606310097533503449582079984816816837125851552273641820339909167103200910805078308128174143174269944095368580519322913514764528012639683546377014716235962867583443566164615728897857285824741767070432119909660645255499710701356135207437699643611094585 139808169914464096465921128085565621767096724855516655439365028496569658038844954238931647642811548254956660405394116677296461848124300258439895306367561416289126854788101396379292925819850897858045772500578222021901631436550118958972312221974009238050517034542286574826081826542722270952769078386418682059418
-91966407878983240112417790733941098492087186469785726449910011271065622315680646030230288265496017310433513856308693810812043160919214636748486185212617634222158204354206411031403206076739932806412551605172319515223573351072757800448643935018534945933808900467686115619932664888581913179496050117713298715475 88086484332488517006277516020842172054013692832175783214603951240851750819999098631851571207693874357651112736088114133607400684776234181681933311972926752846692615822043533641407510569745606256772455614745111122033229877596984718963046218854103292937700694160593653595134512369959987897086639788909618660591
-94633950701209990078055218830969910271587805983595045023718108184189787131629772007048606080263109446462048743696369276578815611098215686598630889831104860221067872883514840819381234786050098278403321905311637820524177879167250981289318356078312300538871435101338967079907049912435983871847334104247675360099 136836393035803488129856151345450008294260680733328546556640578838845312279198933806383329293483852515700876505956362639881210101974254765087350842271260064592406308509078284840473735904755203614987286456952991025347168970462354352741159076541157478949094536405618626397435745496863324654768971213730622037771
-24685127248019769965088146297942173464487677364928435784091685260262292485380918213538979925891771204729738138857126454465630594391449913947358655368215901119137728648638547728497517587701248406019427282237279437409508871300675355166059811431191200555457304463617727969228965042729205402243355816702436970430 103488011917988946858248200111251786178288940265978921633592888293430082248387786443813155999158786903216094876295371112716734481877806417714913656921169196196571699893360825510307056269738593971532017994987406325068886420548597161498019372380511676314312298122272401348856314619382867707981701472607230523868
-116791045850880292989786005885944774698035781824784400772676299590038746153860847252706167458966356897309533614849402276819438194497464696186624618374179812548893947178936305721131565012344462048549467883494038577857638815386798694225798517783768606048713198211730870155881426709644960689953998714045816205549 25767875422998856261320430397505398614439586659207416236135894343577952114994718158163212134503751463610021489053571733974769536157057815413209619147486931502025658987681202196476489081257777148377685478756033509708349637895740799542063593586769082830323796978935454479273531157121440998804334199442003857410
-75582226959658406842894734694860761896800153014775231713388264961517169436476322183886891849966756849783437334069692683523296295601533803799559985845105706728538458624387103621364117548643541824878550074680443708148686601108223917493525070861593238005735446708555769966855130921562955491250908613793521520082 51100990616369611694975829054222013346248289055987940844427061856603230021472379888102172458517294080775792439385531234808129302064303666640376750139242970123503857186428797403843206765926798353022284672682073397573130625177187185114726049347844460311761033584101482859992951420083621362870301150543916815123
-22852401165908224137274273646590366934616265607879280260563022941455466297431255072303172649495519837876946233272420969249841381161312477263365567831938496555136366981954001163034914812189448922853839616662859772087929140818377228980710884492996109434435597500854043325062122184466315338260530734979159890875 35017410720028595029711778101507729481023945551700945988329114663345341120595162378885287946069695772429641825579528116641336456773227542256911497084242947904528367986325800537695079726856460817606404224094336361853766354225558025931211551975334149258299477750615397616908655079967952372222383056221992235704
-37364490883518159794654045194678325635036705086417851509136183713863262621334636905291385255662750747808690129471989906644041585863034419130023070856805511017402434123099100618568335168939301014148587149578150068910141065808373976114927339040964292334109797421173369274978107389084873550233108940239410902552 40916262212189137562350357241447034318002130016858244002788189310078477605649010031339865625243230798681216437501833540185827501244378529230150467789369234869122179247196276164931090039290879808162629109742198951942358028123056268054775108592325500609335947248599688175189333996086475013450537086042387719925
-42030470670714872936404499074069849778147578537708230270030877866700844337372497704027708080369726758812896818567830863540507961487472657570488625639077418109017434494794778542739932765561706796300920251933107517954265066804108669800167526425723377411855061131982689717887180411017924173629124764378241885274 124652439272864857598747946875599560379786580730218192165733924418687522301721706620565030507816884907589477351553268146177293719586287258662025940181301472851649975563004543250656807255226609296537922304346339513054316391667044301386950180277940536542183725690479451746977789001659540839582630251935163344393
-33176766914206542084736303652243484580303865879984981189372762326078776390896986743451688462101732968104375838228070296418541745483112261133079756514082093269959937647525005374035326747696591842313517634077723301677759648869372517403529488493581781546743147639937580084065663597330159470577639629864369972900 67485835091897238609131069363014775606263390149204621594445803179810038685760826651889895397414961195533694176706808504447269558421955735607423135937153901140512527504198912146656610630396284977496295289999655140295415981288181545277299615922576281262872097567020980675200178329219970170480653040350512964539
-131497983897702298481056962402569646971797912524360547236788650961059980711719600424210346263081838703940277066368168874781981151411096949736205282734026497995296147418292226818536168555712128736975034272678008697869326747592750850184857659420541708058277866000692785617873742438060271311159568468507825422571 5400380840349873337222394910303409203226429752629134721503171858543984393161548520471799318518954232197106728096866840965784563043721652790856860155702760027304915133166173298206604451826182024471262142046935060360564569939062438160049193241369468208458085699995573492688298015026628427440418009025072261296
-83265103005695640943261961853521077357830295830250157593141844209296716788437615940096402365505416686459260302419338241462783388722843946886845478224048360927114533590583464979009731440049610985062455108831881153988321298531365779084012803908832525921630534096740755274371500276660832724874701671184539131864 141285570207910287798371174771658911045525474449663877845558585668334618068814605961306961485855329182957174312715910923324965889174835444049526313968571611940626279733302104955951067959291852710640374412577070764165811275030632465290729619533330733368808295932659463215921521905553936914975786500018720073003
-68435028583616495789148116911096163791710022987677894923742899873596891423986951658100606742052014161171185231735413902875605720814417622409817842932759492013585936536452615480700628719795872201528559780249210820284350401473564919576289210869896327937002173624497942136329576506818749730506884927872345019446 134655528287263100540003157571441260698452262106680191153945271167894435782028803135774578949200580551016388918860856991026082917835209212892423567114480975540305860034439015788120390011692862968771136814777768281366591257663821495720134621172848947971117885754539770645621669309650476331439675400544167728223
-97765390064836080322590528352647421920257073063706996347334558390461274981996865736612531330863478931481491964338380362350271734683183807511097331539820133036984271653285063355715726806139083282458695728902452215405696318402583540317419929113959816258829534543044153959951908676300847164682178008704099351835 92552521881196975294401505656851872247567784546370503402756239533783651371688190302773864319828182042605239246779598629409815474038541272600580320815319709309111399294952620375093803971373108792300726524826209329889463854451846561437729676142864421966497641824498079067929811613947148353921163336822026640804
-145767094672933012300753301037546647564595762930138884463767054235112032706630891961371504668013023047595721138624016493638510710257541241706724342585654715468628355455898091951826598092812212209834746162089753649871544789379424903025374228231365026585872808685759231756517703720396301355299998059523896918448 116669462839999965355861187716880953863237226719689755457884414384663576662696981997535568446560375442532084973721539944428004043491468494548231348032618218312515409944970197902589794303562379864012797605284844016184274353252071642511293089390472576498394410829972525726474727579603392265177009323768966538608
-34172517877854802711907683049441723730724885305592620486269966708379625109832852005775048584124451699198484092407720344962116726808090368739361658889584507734617844212547181476646725256303630128954338675520938806905779837227983648887192531356390902975904503218654196581612781227843742951241442641220856414232 126013077261793777773236390821108423367648447987653714614732477073177878509574051196587476846560696305938891953527959347566502332765820074506907037627115954790645652211088723122982633069089920979477728376746424256704724173255656757918995039125823421607024407307091796807227896314403153380323770001854211384322
-9979624731056222925878866378063961280844793874828281622845276060532093809300121084179730782833657205171434732875093693074415298975346410131191865198158876447591891117577190438695367929923494177555818480377241891190442070100052523008290671797937772993634966511431668500154258765510857129203107386972819651767 76559085024395996164590986654274454741199399364851956129137304209855150918182685643729981600389513229011956888957763987167398150792454613751473654448162776379362213885827651020309844507723069713820393068520302223477225569348080362344052033711960892643036147232270133731530049660264526964146237693063093765111
-18162696663677410793062235946366423954875282212790518677684260521370996677183041664345920941714064628111537529793170736292618705900247450994864220481135611781148410617609559050220262121494712903009168783279356915189941268264177631458029177102542745167475619936272581126346266816618866806564180995726437177435 63244550218824945129624987597134280916829928261688093445040235408899092619821698537312158783367974202557699994650667088974727356690181336666077506063310290098995215324552449858513870629176838494348632073938023916155113126203791709810160925798130199717340478393420816876665127594623142175853115698049952126277
-4817943161362708117912118300716778687157593557807116683477307391846133734701449509121209661982298574607233039490570567781316652698287671086985501523197566560479906850423709894582834963398034434055472063156147829131181965140631257939036683622084290629927807369457311894970308590034407761706800045378158588657 61612160237840981966750225147965256022861527286827877531373888434780789812764688703260066154973576040405676432586962624922734102370509771313805122788566405984830112657060375568510809122230960988304085950306616401218206390412815884549481965750553137717475620505076144744211331973240555181377832337912951699135
-36363324947629373144612372870171042343590861026293829791335153646774927623889458346817049419803031378037141773848560341251355283891019532059644644509836766167835557471311319194033709837770615526356168418160386395260066262292757953919140150454538786106958252854181965875293629955562111756775391296856504912587 86831561031659073326747216166881733513938228972332631084118628692228329095617884068498116676787029033973607066377816508795286358748076949738854520048303930186595481606562375516134920902325649683618195251332651685732712539073110524182134321873838204219194459231650917098791250048469346563303077080880339797744
-26406869969418301728540993821409753036653370247174689204659006239823766914991146853283367848649039747728229875444327879875275718711878211919734397349994000106499628652960403076186651083084423734034070082770589453774926850920776427074440483233447839259180467805375782600203654373428926653730090468535611335253 100139935381469543084506312717977196291289016554846164338908226931204624582010530255955411615528804421371905642197394534614355186795223905217732992497673429554618838376065777445760355552020655667172127543653684405493978325270279321013143828897100500212200358450649158287605846102419527584313353072518101626851
-92613116984760565837109105383781193800503303131143575169488835702472221039082994091847595094556327985517286288659598094631489552181233202387028607421487026032402972597880028640156629614572656967808446397456622178472130864873587747608262139844319805074476178618930354824943672367046477408898479503054125369731 30023391082615178562263328892343821010986429338255434046051061316154579824472412477397496718186615690433045030046315908170615910505869972621853946234911296439134838951047107272129711854649412919542407760508235711897489847951451200722151978578883748353566191421685659370090024401368356823252748749449302536931
-31485815361342085113278193504381994806529237123359718043079410511224607873725611862217941085749929342777366642477711445011074784469367917758629403998067347054115844421430072631339788256386509261291675080191633908849638316409182455648806133048549359800886124554879661473112614246869101243501787363247762961784 114503770698890543429251666713050844656853278831559195214556474458830029271801818536133531843456707474500106283648085144619097572354066554819887152106174400667929098257361286338795493838820850475790977445807435511982704395422526800272723708548541616513134676140304653112325071112865020365664833601046215694089
-76882090884790547431641385530818076533805072109483843307806375918023300052767710853172670987385376253156912268523505310624133905633437815297307463917718596711590885553760690350221265675690787249135345226947453988081566088302642706234126002514517416493192624887800567412565527886687096028028124049522890448168 15056463217273240496622619354104573042767532856243223052125822509781815362480522535564283485059790932505429110157271454207173426525345813426696743168079246510944969446574354255284952839036431873039487144279164893710061580467579842173706653409487110282515691099753380094215805485573768509475850463001549608836
-52345178981230648108672997265819959243255047568833938156267924185186047373470984278294897653277996726416846430969793375429223610099546622112048283560483136389901514170116723365811871938630317974150540909650396429631704968748113009366339718498979597226137532343384889080245796447593572468846438769413505393967 32148494517199936472358017244372701214529606506776255341152991328091526865643069587953759877295255050519124541457805199596762210567333445908166076384465183589342153762720515477404466193879418014196727238972417616122646440870364200208488239778452378059236162633837824948613596114768455832408342040970780086
-41095268619128788015767564971105114602454449306041732792746397800275041704886345704294273937217484580365505320134717320083763349380629342859670693445658118959823430378844830923452105707338162448974869312012791385772125813291388247857971218575518319578818336960572244046567099555399203328678654466958536663208 92166550199033418923713824997841892577149715275633481076285269142670107687867024550593869464613175882141630640739938334001211714884975032600306279287443909448541179109981755796752132502127330056736913454039526413284519137059580845856736918773597087836203497066909257930043736166431682872083389105176299181629
-40049143661018504441607875135884755310012910557581028447435354354754245291878800571089144452035026644953322330676651798951447670184106450649737772686119714700743396359069052813433030118630105307022867200053964644574786137276428546712005171080129190959914708907200288299169344380390093918556722227705114244981 108159089972386282154772900619022507336076619354549601813179459338897131937353741544606392560724999980281424266891537298473163753022749859939445293926707568015958367188089915420630082556748668489756475027008449860889202622698060097015044886961901650857610841562477736791450080980702347705778074391774667412741
-69905259478181995876884927656894491893594530150260951315109404530530357998889589977208787140430938039028941393673520799460431992051993157468616168400324834880926190141581037597526917869362292931957289043707855837933490285814769110495657056206391880865972389421774822461752702336812585852278453803972600333734 71821415380277072313878763768684432371552628204186742842154591000123020597011744840460964835414360968627162765288463383113375595799297552681618876474019263288277398833725479226930770694271622605114061622753165584075733358178384410640349907375170170910499615355511313349300918885560131539570707695789106185664
-26945345439378873515011714350080059082081595419023056538696949766471272811362104837806324694947413603019863785876836706911406330379274553386254346050697348395574746891556054334903838949157798006141473389066020212044825140294048709654273698482867946522782450500680195477050110145664069582549935651920545151500 80313315938584480048642653013876614091607852535582224914294013785054094052454758327935781971746329853786568549510067442145637007308960551652864942042189241081946607011847245280773379099020221884296226818685556430275385068764313042226925852500883894269809033380734632866477789520106865758504064806906234130588
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/hmac.txt b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/hmac.txt
deleted file mode 100644
index 4299a9655..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/hmac.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-test_case = 1
-key = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
-key_len = 20
-data = "Hi There"
-data_len = 8
-digest = 0xb617318655057264e28bc0b6fb378c8ef146be00
-
-test_case = 2
-key = "Jefe"
-key_len = 4
-data = "what do ya want for nothing?"
-data_len = 28
-digest = 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79
-
-test_case = 3
-key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-key_len = 20
-data = 0xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
-data_len = 50
-digest = 0x125d7342b9ac11cd91a39af48aa17b4f63f175d3
-
-test_case = 4
-key = 0x0102030405060708090a0b0c0d0e0f10111213141516171819
-key_len = 25
-data = 0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
-data_len = 50
-digest = 0x4c9007f4026250c6bc8414f9bf50c86c2d7235da
-
-test_case = 5
-key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
-key_len = 20
-data = "Test With Truncation"
-data_len = 20
-digest = 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04
-digest-96 = 0x4c1a03424b55e07fe7f27be1
-
-test_case = 6
-key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-key_len = 80
-data = "Test Using Larger Than Block-Size Key - Hash Key First"
-data_len = 54
-digest = 0xaa4ae5e15272d00e95705637ce8a3b55ed402112
-
-test_case = 7
-key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-key_len = 80
-data = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
-data_len = 73
-digest = 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91
diff --git a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/linkparse.txt b/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/linkparse.txt
deleted file mode 100644
index 91121231c..000000000
--- a/modules/member/php-openid-1.2.3/Tests/Auth/OpenID/data/linkparse.txt
+++ /dev/null
@@ -1,594 +0,0 @@
-Num Tests: 73
-
-OpenID link parsing test cases
-Copyright (C) 2005-2006, JanRain, Inc.
-See COPYING for license information.
-
-File format
------------
-
-All text before the first triple-newline (this chunk) should be ignored.
-
-This file may be interpreted as Latin-1 or UTF-8.
-
-Test cases separated by three line separators (`\n\n\n'). The test
-cases consist of a headers section followed by a data block. These are
-separated by a double newline. The headers consist of the header name,
-followed by a colon, a space, the value, and a newline. There must be
-one, and only one, `Name' header for a test case. There may be zero or
-more link headers. The `Link' header consists of whitespace-separated
-attribute pairs. A link header with an empty string as a value
-indicates an empty but present link tag. The attribute pairs are `='
-separated and not quoted.
-
-Optional Links and attributes have a trailing `*'. A compilant
-implementation may produce this as output or may not. A compliant
-implementation will not produce any output that is absent from this
-file.
-
-
-Name: Well-formed link rel (in CAPS)
-Link: rel=openid.server href=http://www.myopenid.com/server
-
-
-
-
-
-
-
-
-Name: No link tag at all
-
-
-
-
-
-
-
-Name: Link element first
-
-
-
-
-Name: Link inside HTML, not head
-
-
-
-
-
-Name: Link inside head, not html
-
-
-
-
-
-Name: Link inside html, after head
-
-
-
-
-
-
-
-Name: Link inside html, before head
-
-
-
-
-
-
-Name: Link before html and head
-
-
-
-
-
-
-Name: Link after html document with head
-
-
-
-
-
-
-
-
-Name: Link inside html inside head, inside another html
-
-
-
-
-
-
-
-Name: Link inside html inside head
-
-
-
-
-
-
-Name: link inside body inside head inside html
-
-
-
-
-
-
-
-Name: Link inside head inside head inside html
-
-
-
-
-
-
-
-Name: Link inside script inside head inside html
-
-
-
-
-
-
-Name: Link inside comment inside head inside html
-
-
-
-
-
-
-Name: Link inside of head after short head
-
-
-