summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2005-12-30 20:46:29 +0000
committertailor <cygnus@janrain.com>2005-12-30 20:46:29 +0000
commit78559f3aebe5e2a5591e88c7b4947f5cdc505817 (patch)
tree52994c852b5c4d1d1d7172c6002217abacf38e68
parent977e9dc10d959800341f270587d3fe7adfc9fd68 (diff)
downloadphp-openid-78559f3aebe5e2a5591e88c7b4947f5cdc505817.zip
php-openid-78559f3aebe5e2a5591e88c7b4947f5cdc505817.tar.gz
php-openid-78559f3aebe5e2a5591e88c7b4947f5cdc505817.tar.bz2
[project @ Added DumbStore implementation]
-rw-r--r--Net/OpenID/Store/DumbStore.php54
1 files changed, 52 insertions, 2 deletions
diff --git a/Net/OpenID/Store/DumbStore.php b/Net/OpenID/Store/DumbStore.php
index 62f0185..4fef0b5 100644
--- a/Net/OpenID/Store/DumbStore.php
+++ b/Net/OpenID/Store/DumbStore.php
@@ -35,7 +35,7 @@ require('Net/OpenID/CryptUtil.php');
class Net_OpenID_DumbStore extends Net_OpenID_OpenIDStore {
/**
- * Creates a new Net_OpenID_OpenIDStore instance. For the security
+ * Creates a new Net_OpenID_DumbStore instance. For the security
* of the tokens generated by the library, this class attempts to
* at least have a secure implementation of getAuthKey.
*
@@ -45,7 +45,7 @@ class Net_OpenID_DumbStore extends Net_OpenID_OpenIDStore {
* string as the secret phrase, which means you can make it very
* difficult to guess.
*
- * Each Net_OpenID_OpenIDStore instance that is created for use by
+ * Each Net_OpenID_DumbStore instance that is created for use by
* your consumer site needs to use the same $secret_phrase.
*
* @param string secret_phrase The phrase used to create the auth
@@ -54,6 +54,56 @@ class Net_OpenID_DumbStore extends Net_OpenID_OpenIDStore {
function Net_OpenID_DumbStore($secret_phrase) {
$this->auth_key = Net_OpenID_CryptUtil::sha1($secret_phrase);
}
+
+ /**
+ * This implementation does nothing.
+ */
+ function storeAssociation($server_url, $association) {
+ }
+
+ /**
+ * This implementation always returns null.
+ */
+ function getAssociation($server_url, $handle = null) {
+ return null;
+ }
+
+ /**
+ * This implementation always returns false.
+ */
+ function removeAssociation($server_url, $handle) {
+ return false;
+ }
+
+ /**
+ * This implementation does nothing.
+ */
+ function storeNonce($nonce) {
+ }
+
+ /**
+ * In a system truly limited to dumb mode, nonces must all be
+ * accepted. This therefore always returns true, which makes
+ * replay attacks feasible during the lifespan of the token.
+ */
+ function useNonce($nonce) {
+ return true;
+ }
+
+ /**
+ * This method returns the auth key generated by the constructor.
+ */
+ function getAuthKey() {
+ return $this->auth_key;
+ }
+
+ /**
+ * This store is a dumb mode store, so this method is overridden
+ * to return true.
+ */
+ function isDumb() {
+ return true;
+ }
}
?> \ No newline at end of file