Skip to content
Snippets Groups Projects
Commit 5e92f288 authored by Olav Morken's avatar Olav Morken
Browse files

saml:sp: Fix decryption of NameID.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2748 44740490-163a-0410-bde0-09ae8108e29a
parent 8a2890fa
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ if ($message instanceof SAML2_LogoutResponse) {
if ($message->isNameIdEncrypted()) {
try {
$keys = sspmod_saml_Message::getDecryptionKeys($srcMetadata, $dstMetadata);
$keys = sspmod_saml_Message::getDecryptionKeys($idpMetadata, $spMetadata);
} catch (Exception $e) {
throw new SimpleSAML_Error_Exception('Error decrypting NameID: ' . $e->getMessage());
}
......@@ -74,12 +74,16 @@ if ($message instanceof SAML2_LogoutResponse) {
try {
$message->decryptNameId($key);
SimpleSAML_Logger::debug('Decryption with key #' . $i . ' succeeded.');
$lastException = NULL;
break;
} catch (Exception $e) {
SimpleSAML_Logger::debug('Decryption with key #' . $i . ' failed with exception: ' . $e->getMessage());
$lastException = $e;
}
}
throw $lastException;
if ($lastException !== NULL) {
throw $lastException;
}
}
$nameId = $message->getNameId();
......
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