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

AuthnResponse: Use SimpleSAML_Utilities::loadPrivateKey

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@930 44740490-163a-0410-bde0-09ae8108e29a
parent f84b0db5
No related branches found
No related tags found
No related merge requests found
......@@ -192,17 +192,11 @@ class SimpleSAML_XML_SAML20_AuthnResponse extends SimpleSAML_XML_AuthnResponse {
if ($objKeyInfo = $objenc->locateKeyInfo($objKey)) {
if ($objKeyInfo->isEncrypted) {
$objencKey = $objKeyInfo->encryptedCtx;
if (!isset($spmd['privatekey'])) {
throw new Exception("Private key for decrypting assertion needed, but not specified for saml20-sp-hosted id: " . $spid);
$privatekey = SimpleSAML_Utilities::loadPrivateKey($spmd, TRUE);
if(array_key_exists('password', $privatekey)) {
$objKeyInfo->passphrase = $privatekey['password'];
}
$privatekey = @file_get_contents($this->configuration->getPathValue('certdir') . $spmd['privatekey']);
if ($privatekey === FALSE) {
throw new Exception("Private key for decrypting assertion specified but not found for saml20-sp-hosted id: " . $spid . " Filename: " . $spmd['privatekey']);
}
if(array_key_exists('privatekey_pass', $spmd)) {
$objKeyInfo->passphrase = $spmd['privatekey_pass'];
}
$objKeyInfo->loadKey($privatekey);
$objKeyInfo->loadKey($privatekey['PEM']);
$key = $objencKey->decryptKey($objKeyInfo);
} else {
$idpmd = $this->metadata->getMetaData($this->issuer, 'saml20-idp-remote');
......
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