summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Hoyt <josh@janrain.com>2006-01-25 13:58:04 +0000
committerJosh Hoyt <josh@janrain.com>2006-01-25 13:58:04 +0000
commit473adb296aa90f916b6dc2ec0d7192387b1b01b1 (patch)
treeaaf8369d15818c672004180cbe569f4f8cf4e8f0
parent310b8541ca9fee8a8bfdd5c58182ad8214b77400 (diff)
downloadphp-openid-473adb296aa90f916b6dc2ec0d7192387b1b01b1.zip
php-openid-473adb296aa90f916b6dc2ec0d7192387b1b01b1.tar.gz
php-openid-473adb296aa90f916b6dc2ec0d7192387b1b01b1.tar.bz2
[project @ Diffie-Hellman associate error test and fixes]
-rw-r--r--Auth/OpenID/DiffieHellman.php2
-rw-r--r--Tests/Auth/OpenID/Server.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/Auth/OpenID/DiffieHellman.php b/Auth/OpenID/DiffieHellman.php
index 20c0827..82208bb 100644
--- a/Auth/OpenID/DiffieHellman.php
+++ b/Auth/OpenID/DiffieHellman.php
@@ -123,7 +123,7 @@ class Auth_OpenID_DiffieHellman {
$gen = null;
}
- $cpub64 = $consumer_args['openid.dh_consumer_public'];
+ $cpub64 = @$consumer_args['openid.dh_consumer_public'];
if (!isset($cpub64)) {
return false;
}
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php
index 4f57f9b..9426fc4 100644
--- a/Tests/Auth/OpenID/Server.php
+++ b/Tests/Auth/OpenID/Server.php
@@ -139,4 +139,13 @@ class Tests_Auth_OpenID_Server extends PHPUnit_TestCase {
$this->assertEquals('string', gettype($secret));
$this->assertTrue(strlen($secret) > 0);
}
+
+ function test_associateDHnoKey()
+ {
+ $args = array('openid.session_type' => 'DH-SHA1');
+ list($status, $info) = $this->server->associate($args);
+ $this->assertEquals(Auth_OpenID_REMOTE_ERROR, $status);
+ $ra = Auth_OpenID_KVForm::kvToArray($info);
+ $this->assertKeyExists('error', $ra);
+ }
}