Skip to content
Snippets Groups Projects
Commit e4cdf7c8 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Do not trust expired metadata.. throw exception...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1530 44740490-163a-0410-bde0-09ae8108e29a
parent 5f46f4a7
No related branches found
No related tags found
No related merge requests found
...@@ -295,7 +295,17 @@ class SimpleSAML_Metadata_MetaDataStorageHandler { ...@@ -295,7 +295,17 @@ class SimpleSAML_Metadata_MetaDataStorageHandler {
foreach($this->sources as $source) { foreach($this->sources as $source) {
$metadata = $source->getMetaData($index, $set); $metadata = $source->getMetaData($index, $set);
if($metadata !== NULL) { if($metadata !== NULL) {
if (array_key_exists('expire', $metadata)) {
if ($metadata['expire'] < time()) {
throw new Exception('Metadata for the entity [' . $index . '] expired ' .
(time() - $metadata['expire']) . ' seconds ago.'
);
}
}
$metadata['metadata-index'] = $index; $metadata['metadata-index'] = $index;
$metadata['metadata-set'] = $set; $metadata['metadata-set'] = $set;
return $metadata; return $metadata;
......
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