Skip to content
Snippets Groups Projects
Commit 980b34c7 authored by Jaime Pérez's avatar Jaime Pérez
Browse files

bugfix: In case an empty SubjectConfirmation is received, an appropriate error must be thrown.

This resolves #530. There are two problems here:

- When only one SubjectConfirmation is received and it is empty, an error should be thrown. However, the error would be a not very descriptive message warning about access to a non-property in a null object. Something more descriptive should be in place.
- Additionally, in PHP 7.0 this is an error and not an exception, and then the code continues to execute, effectively allowing assertions without a proper SubjectConfirmation element. This is wrong according to the standard.
parent 329d748d
No related branches found
No related tags found
No related merge requests found
......@@ -689,6 +689,12 @@ class sspmod_saml_Message {
}
}
// if no SubjectConfirmationData then don't do anything.
if ($scd === null) {
$lastError = 'No SubjectConfirmationData provided';
continue;
}
if ($scd->NotBefore && $scd->NotBefore > time() + 60) {
$lastError = 'NotBefore in SubjectConfirmationData is in the future: ' . $scd->NotBefore;
continue;
......
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