summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-09-25 19:09:42 +0000
committertailor <cygnus@janrain.com>2007-09-25 19:09:42 +0000
commitf4f7744cae65f182fe9d3814d2e3af20407b1555 (patch)
treedc5a8c17d27e61492e0a6f91af0b82662724762a
parentb5e5cd7c3f57c915f16829c95a4cf681032885ee (diff)
downloadphp-openid-f4f7744cae65f182fe9d3814d2e3af20407b1555.zip
php-openid-f4f7744cae65f182fe9d3814d2e3af20407b1555.tar.gz
php-openid-f4f7744cae65f182fe9d3814d2e3af20407b1555.tar.bz2
[project @ gmmktime() -> mktime() since gmmktime() is broken in PHP 4]
-rw-r--r--Auth/OpenID/FileStore.php2
-rw-r--r--Auth/OpenID/SQLStore.php2
-rw-r--r--Tests/Auth/OpenID/MemStore.php12
3 files changed, 12 insertions, 4 deletions
diff --git a/Auth/OpenID/FileStore.php b/Auth/OpenID/FileStore.php
index b312a66..a00c43f 100644
--- a/Auth/OpenID/FileStore.php
+++ b/Auth/OpenID/FileStore.php
@@ -366,7 +366,7 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
return null;
}
- if ( abs($timestamp - gmmktime()) > $Auth_OpenID_SKEW ) {
+ if ( abs($timestamp - mktime()) > $Auth_OpenID_SKEW ) {
return False;
}
diff --git a/Auth/OpenID/SQLStore.php b/Auth/OpenID/SQLStore.php
index 15f7971..2fae5d3 100644
--- a/Auth/OpenID/SQLStore.php
+++ b/Auth/OpenID/SQLStore.php
@@ -497,7 +497,7 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore {
{
global $Auth_OpenID_SKEW;
- if ( abs($timestamp - gmmktime()) > $Auth_OpenID_SKEW ) {
+ if ( abs($timestamp - mktime()) > $Auth_OpenID_SKEW ) {
return False;
}
diff --git a/Tests/Auth/OpenID/MemStore.php b/Tests/Auth/OpenID/MemStore.php
index 160f0b4..aa562c3 100644
--- a/Tests/Auth/OpenID/MemStore.php
+++ b/Tests/Auth/OpenID/MemStore.php
@@ -4,6 +4,7 @@
* In-memory OpenID store implementation for testing only
*/
require_once "Auth/OpenID/Interface.php";
+require_once 'Auth/OpenID/Nonce.php';
class ServerAssocs {
function ServerAssocs()
@@ -114,8 +115,15 @@ class Tests_Auth_OpenID_MemStore {
function useNonce($server_url, $timestamp, $salt)
{
- $nonce = sprintf("%s%s%s", $server_url, $timestamp, $salt);
- if (in_array($nonce, $this->nonces)) {
+ global $Auth_OpenID_SKEW;
+
+ if (abs($timestamp - mktime()) > $Auth_OpenID_SKEW) {
+ return false;
+ }
+
+ $anonce = array($server_url, intval($timestamp), $salt);
+
+ if (in_array($anonce, $this->nonces)) {
return false;
} else {
array_push($this->nonces, $anonce);