Skip to content

Commit cf2ccb7

Browse files
committed
ALOWED Misspell
1 parent 8c8f1f6 commit cf2ccb7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

lib/Saml2/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class 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';

lib/Saml2/Response.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)