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

Metadata_SAMLParser: Add support for multiple certificates.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@689 44740490-163a-0410-bde0-09ae8108e29a
parent 4c5bf567
No related branches found
No related tags found
No related merge requests found
...@@ -415,7 +415,8 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -415,7 +415,8 @@ class SimpleSAML_Metadata_SAMLParser {
} }
$ret['SingleSignOnService'] = $sso['location']; $ret['SingleSignOnService'] = $sso['location'];
/* Find the certificate fingerprint. */ /* Find the certificate fingerprints. */
$ret['certFingerprint'] = array();
foreach($idp['keys'] as $key) { foreach($idp['keys'] as $key) {
if($key['type'] !== 'X509Certificate') { if($key['type'] !== 'X509Certificate') {
continue; continue;
...@@ -423,7 +424,7 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -423,7 +424,7 @@ class SimpleSAML_Metadata_SAMLParser {
$certData = base64_decode($key['X509Certificate']); $certData = base64_decode($key['X509Certificate']);
if($certData === FALSE) { if($certData === FALSE) {
break; continue;
/* /*
* At 2008-06-18 we removed the requirement for certificate to be emedded in metadata. Instead * At 2008-06-18 we removed the requirement for certificate to be emedded in metadata. Instead
* of throwing an exception which caused the whole parsing to crash, we just skip adding the * of throwing an exception which caused the whole parsing to crash, we just skip adding the
...@@ -433,7 +434,7 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -433,7 +434,7 @@ class SimpleSAML_Metadata_SAMLParser {
*/ */
} }
$ret['certFingerprint'] = sha1($certData); $ret['certFingerprint'][] = sha1($certData);
break; break;
} }
...@@ -558,6 +559,7 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -558,6 +559,7 @@ class SimpleSAML_Metadata_SAMLParser {
/* Find the certificate fingerprint. */ /* Find the certificate fingerprint. */
$ret['certFingerprint'] = array();
foreach($idp['keys'] as $key) { foreach($idp['keys'] as $key) {
if($key['type'] !== 'X509Certificate') { if($key['type'] !== 'X509Certificate') {
continue; continue;
...@@ -568,7 +570,7 @@ class SimpleSAML_Metadata_SAMLParser { ...@@ -568,7 +570,7 @@ class SimpleSAML_Metadata_SAMLParser {
throw new Exception('Unable to parse base64 encoded certificate data.'); throw new Exception('Unable to parse base64 encoded certificate data.');
} }
$ret['certFingerprint'] = sha1($certData); $ret['certFingerprint'][] = sha1($certData);
break; break;
} }
......
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