Skip to content
Snippets Groups Projects
Commit d316beeb authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Fixed a bug on ArtifactResolutionService introduced by a previous commit on...

Fixed a bug on ArtifactResolutionService introduced by a previous commit on new SHA signatures support.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3186 44740490-163a-0410-bde0-09ae8108e29a
parent 5e5f0a2b
No related branches found
No related tags found
No related merge requests found
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
class sspmod_saml_Message { class sspmod_saml_Message {
/** /**
* Add signature key and and senders certificate to an element (Message or Assertion). * Add signature key and sender certificate to an element (Message or Assertion).
* *
* @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender.
* @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient.
* @param SAML2_Message $element The element we should add the data to. * @param SAML2_Message $element The element we should add the data to.
*/ */
public static function addSign(SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata = NULL, SAML2_SignedElement $element) { public static function addSign(SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, SAML2_SignedElement $element) {
$keyArray = SimpleSAML_Utilities::loadPrivateKey($srcMetadata, TRUE); $keyArray = SimpleSAML_Utilities::loadPrivateKey($srcMetadata, TRUE);
$certArray = SimpleSAML_Utilities::loadPublicKey($srcMetadata, FALSE); $certArray = SimpleSAML_Utilities::loadPublicKey($srcMetadata, FALSE);
......
...@@ -34,6 +34,10 @@ $request = $binding->receive(); ...@@ -34,6 +34,10 @@ $request = $binding->receive();
if (!($request instanceof SAML2_ArtifactResolve)) { if (!($request instanceof SAML2_ArtifactResolve)) {
throw new Exception('Message received on ArtifactResolutionService wasn\'t a ArtifactResolve request.'); throw new Exception('Message received on ArtifactResolutionService wasn\'t a ArtifactResolve request.');
} }
$issuer = $request->getIssuer();
$spMetadata = $metadata->getMetadataConfig($issuer, 'saml20-sp-remote');
$artifact = $request->getArtifact(); $artifact = $request->getArtifact();
$responseData = $store->get('artifact', $artifact); $responseData = $store->get('artifact', $artifact);
...@@ -51,5 +55,5 @@ $artifactResponse = new SAML2_ArtifactResponse(); ...@@ -51,5 +55,5 @@ $artifactResponse = new SAML2_ArtifactResponse();
$artifactResponse->setIssuer($idpEntityId); $artifactResponse->setIssuer($idpEntityId);
$artifactResponse->setInResponseTo($request->getId()); $artifactResponse->setInResponseTo($request->getId());
$artifactResponse->setAny($responseXML); $artifactResponse->setAny($responseXML);
sspmod_saml_Message::addSign($idpMetadata, NULL, $artifactResponse); sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $artifactResponse);
$binding->send($artifactResponse); $binding->send($artifactResponse);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment