summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@cprogrammer.org>2007-11-13 01:30:42 +0000
committertailor <cygnus@cprogrammer.org>2007-11-13 01:30:42 +0000
commit5203594829f55e334f75f29adfab4f2ccc06bb4e (patch)
treeab1e7afba6b98a331c29572608c8e7c50e945c33
parent1bcb0af7df31c20817a7f3374a16c496c8310266 (diff)
downloadphp-openid-5203594829f55e334f75f29adfab4f2ccc06bb4e.zip
php-openid-5203594829f55e334f75f29adfab4f2ccc06bb4e.tar.gz
php-openid-5203594829f55e334f75f29adfab4f2ccc06bb4e.tar.bz2
[project @ Make setAllowedTypes make sure that the association types and session types are allowed by OpenID]
-rw-r--r--Auth/OpenID/Association.php2
-rw-r--r--Tests/Auth/OpenID/Negotiation.php12
2 files changed, 5 insertions, 9 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php
index 16c83bf..b77ac84 100644
--- a/Auth/OpenID/Association.php
+++ b/Auth/OpenID/Association.php
@@ -518,7 +518,7 @@ function &Auth_OpenID_getEncryptedNegotiator()
class Auth_OpenID_SessionNegotiator {
function Auth_OpenID_SessionNegotiator($allowed_types)
{
- $this->allowed_types = $allowed_types;
+ $this->setAllowedTypes($allowed_types);
}
/**
diff --git a/Tests/Auth/OpenID/Negotiation.php b/Tests/Auth/OpenID/Negotiation.php
index a7f4303..c5ad873 100644
--- a/Tests/Auth/OpenID/Negotiation.php
+++ b/Tests/Auth/OpenID/Negotiation.php
@@ -117,9 +117,7 @@ class TestOpenID2SessionNegotiation extends PHPUnit_TestCase {
*/
function testNotAllowed()
{
- $allowed_types = array(
- array('assoc_bogus', 'session_bogus')
- );
+ $allowed_types = array();
$negotiator = new Auth_OpenID_SessionNegotiator($allowed_types);
$this->consumer->negotiator = $negotiator;
@@ -252,9 +250,7 @@ class TestOpenID1SessionNegotiation extends PHPUnit_TestCase {
function testNotAllowed()
{
- $allowed_types = array(
- array('assoc_bogus', 'session_bogus')
- );
+ $allowed_types = array();
$negotiator = new Auth_OpenID_SessionNegotiator($allowed_types);
$this->consumer->negotiator = $negotiator;
@@ -305,8 +301,8 @@ class TestNegotiatorBehaviors extends PHPUnit_TestCase {
function setUp()
{
$this->allowed_types = array(
- array('assoc1', 'session1'),
- array('assoc2', 'session2')
+ array('HMAC-SHA1', 'no-encryption'),
+ array('HMAC-SHA256', 'no-encryption')
);
$this->n = new Auth_OpenID_SessionNegotiator($this->allowed_types);