summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Auth/TimeLimitedToken.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SimpleSAML/Auth/TimeLimitedToken.php')
-rw-r--r--lib/SimpleSAML/Auth/TimeLimitedToken.php13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/SimpleSAML/Auth/TimeLimitedToken.php b/lib/SimpleSAML/Auth/TimeLimitedToken.php
index 3c991ce..5a59b7a 100644
--- a/lib/SimpleSAML/Auth/TimeLimitedToken.php
+++ b/lib/SimpleSAML/Auth/TimeLimitedToken.php
@@ -14,7 +14,7 @@ class SimpleSAML_Auth_TimeLimitedToken {
*/
public function __construct( $lifetime = 900, $secretSalt = NULL, $skew = 1) {
if ($secretSalt === NULL) {
- $secretSalt = SimpleSAML_Utilities::getSecretSalt();
+ $secretSalt = SimpleSAML\Utils\Config::getSecretSalt();
}
$this->secretSalt = $secretSalt;
@@ -39,9 +39,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
* Calculate the given time slot for a given offset.
*/
private function calculate_time_slot($offset) {
-
- #echo 'lifetime is: ' . $this->lifetime;
-
$timeslot = floor( (time() - $offset) / ($this->lifetime + $this->skew) );
return $timeslot;
}
@@ -51,10 +48,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
*/
private function calculate_tokenvalue($offset) {
// A secret salt that should be randomly generated for each installation.
- #echo 'Secret salt is: ' . $this->secretSalt;
-
- #echo '<p>Calculating sha1( ' . $this->calculate_time_slot($offset) . ':' . $this->secretSalt . ' )<br />';
-
return sha1( $this->calculate_time_slot($offset) . ':' . $this->secretSalt);
}
@@ -74,10 +67,6 @@ class SimpleSAML_Auth_TimeLimitedToken {
$splittedtoken = explode('-', $token);
$offset = hexdec($splittedtoken[0]);
$value = $splittedtoken[1];
-
-
- #echo 'compare [' . $this->calculate_tokenvalue($offset). '] with [' . $value . '] offset was [' . $offset. ']';
-
return ($this->calculate_tokenvalue($offset) === $value);
}