From f16818241f36539bffc4bb91633f3b2de037ba4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Tue, 23 Jun 2009 09:36:34 +0000
Subject: [PATCH] Add support for private key password

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1538 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/InfoCard/lib/Auth/Source/ICAuth.php | 3 ++-
 modules/InfoCard/lib/RP/InfoCard.php        | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/InfoCard/lib/Auth/Source/ICAuth.php b/modules/InfoCard/lib/Auth/Source/ICAuth.php
index 47d85f86c..214d5ab38 100644
--- a/modules/InfoCard/lib/Auth/Source/ICAuth.php
+++ b/modules/InfoCard/lib/Auth/Source/ICAuth.php
@@ -48,11 +48,12 @@ SimpleSAML_Logger::debug('ENTRA en icauth');
 		$config = SimpleSAML_Configuration::getInstance();
 		$autoconfig = $config->copyFromBase('logininfocard', 'config-login-infocard.php');
 		$idp_key = $autoconfig->getValue('idp_key');
+		$idp_pass = $autoconfig->getValue('idp_key_pass', NULL);
 		$sts_crt = $autoconfig->getValue('sts_crt');
 		$Infocard =   $autoconfig->getValue('InfoCard');
 
 		$infocard = new sspmod_InfoCard_RP_InfoCard();
-		$infocard->addIDPKey($idp_key);
+		$infocard->addIDPKey($idp_key, $idp_key_pass);
 		$infocard->addSTSCertificate($sts_crt);	
 		if (!$xmlToken)     
 			SimpleSAML_Logger::debug("XMLtoken: ".$xmlToken);
diff --git a/modules/InfoCard/lib/RP/InfoCard.php b/modules/InfoCard/lib/RP/InfoCard.php
index 254c30139..8cc7fb800 100644
--- a/modules/InfoCard/lib/RP/InfoCard.php
+++ b/modules/InfoCard/lib/RP/InfoCard.php
@@ -120,10 +120,10 @@ SimpleSAML_Logger::debug('IC: secureToken');
     catch(Exception $e) {
 			SimpleSAML_Logger::debug('ProcSecToken '.$e);
       $retval->setError('Failed to extract assertion document');
-      throw new Exception('Failed to extract assertion document');
+      throw new Exception('Failed to extract assertion document: ' . $e->getMessage());
       $retval->setCode(Zend_InfoCard_Claims::RESULT_PROCESSING_FAILURE);
       return $retval;
-    }
+	}
 
     try {
       $assertions = self::getAssertions($decryptedToken);    
-- 
GitLab