/** * testNoSignedKeys * * @return void */ public function testNoSignedKeys() { $message = new OpenID_Message(); $message->set('openid.assoc_handle', $this->object->assocHandle); $message->set('openid.op_endpoint', 'http://example.com'); $this->assertFalse($this->object->checkMessageSignature($message)); }
/** * Verifies the signature of this message association. * * @param OpenID_Association $assoc Association to use for checking the signature * * @return bool result of OpenID_Association::checkMessageSignature() * @see OpenID_Association::checkMessageSignature() */ public function verifySignature(OpenID_Association $assoc) { return $assoc->checkMessageSignature($this->message); }
/** * testVerifySignature * * @return void */ public function testVerifySignature() { $opEndpoint = new OpenID_ServiceEndpoint(); $opEndpoint->setURIs(array($this->opEndpointURL)); $opEndpoints = new OpenID_ServiceEndpoints($this->claimedID, $opEndpoint); $this->discover = $this->getMock('OpenID_Discover', array('__get'), array($this->claimedID)); $this->discover->expects($this->once())->method('__get')->will($this->returnValue($opEndpoints)); $this->store->expects($this->once())->method('getDiscover')->will($this->returnValue($this->discover)); $this->store->expects($this->once())->method('getNonce')->will($this->returnValue(false)); $this->createObjects(); $association = new OpenID_Association(array('uri' => $this->opEndpointURL, 'expiresIn' => 600, 'created' => time(), 'assocType' => 'HMAC-SHA1', 'assocHandle' => '12345', 'sharedSecret' => '6789')); $this->message->set('openid.assoc_handle', '12345'); $association->signMessage($this->message); $this->assertTrue($this->assertion->verifySignature($association)); $this->message->set('openid.sig', 'foo'); $this->assertFalse($this->assertion->verifySignature($association)); }