File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1053,6 +1053,7 @@ Main class of OneLogin PHP Toolkit
10531053 * ` getErrors ` - Returns if there were any error
10541054 * ` getSSOurl ` - Gets the SSO url.
10551055 * ` getSLOurl ` - Gets the SLO url.
1056+ * ` getLastRequestID ` - The ID of the last Request SAML message generated.
10561057 * ` buildRequestSignature ` - Generates the Signature for a SAML Request
10571058 * ` buildResponseSignature ` - Generates the Signature for a SAML Response
10581059 * ` getSettings ` - Returns the settings info
Original file line number Diff line number Diff line change 88class OneLogin_Saml2_Constants
99{
1010 // Value added to the current time in time condition validations
11- const ALOWED_CLOCK_DRIFT = 180 ; // 3 min in seconds
11+ const ALLOWED_CLOCK_DRIFT = 180 ; // 3 min in seconds
1212
1313 // NameID Formats
1414 const NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress ' ;
Original file line number Diff line number Diff line change @@ -258,6 +258,9 @@ public function isValid($requestId = null)
258258 }
259259
260260 if (!empty ($ signedElements )) {
261+ if (count ($ signedElements ) > 2 ) {
262+ throw new Exception ("Too many Signatures found. SAML Response rejected " );
263+ }
261264 $ cert = $ idpData ['x509cert ' ];
262265 $ fingerprint = $ idpData ['certFingerprint ' ];
263266 $ fingerprintalg = $ idpData ['certFingerprintAlgorithm ' ];
@@ -513,10 +516,10 @@ public function validateTimestamps()
513516 for ($ i = 0 ; $ i < $ timestampNodes ->length ; $ i ++) {
514517 $ nbAttribute = $ timestampNodes ->item ($ i )->attributes ->getNamedItem ("NotBefore " );
515518 $ naAttribute = $ timestampNodes ->item ($ i )->attributes ->getNamedItem ("NotOnOrAfter " );
516- if ($ nbAttribute && OneLogin_SAML2_Utils::parseSAML2Time ($ nbAttribute ->textContent ) > time () + OneLogin_Saml2_Constants::ALOWED_CLOCK_DRIFT ) {
519+ if ($ nbAttribute && OneLogin_SAML2_Utils::parseSAML2Time ($ nbAttribute ->textContent ) > time () + OneLogin_Saml2_Constants::ALLOWED_CLOCK_DRIFT ) {
517520 return false ;
518521 }
519- if ($ naAttribute && OneLogin_SAML2_Utils::parseSAML2Time ($ naAttribute ->textContent ) + OneLogin_Saml2_Constants::ALOWED_CLOCK_DRIFT <= time ()) {
522+ if ($ naAttribute && OneLogin_SAML2_Utils::parseSAML2Time ($ naAttribute ->textContent ) + OneLogin_Saml2_Constants::ALLOWED_CLOCK_DRIFT <= time ()) {
520523 return false ;
521524 }
522525 }
You can’t perform that action at this time.
0 commit comments