diff options
-rw-r--r-- | Auth/OpenID/Association.php | 6 | ||||
-rw-r--r-- | Auth/OpenID/BigMath.php | 12 | ||||
-rw-r--r-- | Auth/OpenID/Consumer/Parse.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/CryptUtil.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/DiffieHellman.php | 2 | ||||
-rw-r--r-- | Auth/OpenID/HMACSHA1.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/KVForm.php | 7 | ||||
-rw-r--r-- | Auth/OpenID/Server.php | 6 | ||||
-rw-r--r-- | Auth/OpenID/Store/SQLStore.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/TrustRoot.php | 31 | ||||
-rw-r--r-- | admin/makedoc.sh | 5 |
11 files changed, 64 insertions, 9 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index 5fd967b..dbdc8af 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -37,11 +37,15 @@ class Auth_OpenID_Association { /** * This is a HMAC-SHA1 specific value. + * + * @access private */ var $SIG_LENGTH = 20; /** * The ordering and name of keys as stored by serialize. + * + * @access private */ var $assoc_keys = array( 'version', @@ -57,6 +61,8 @@ class Auth_OpenID_Association { * library to create associations. OpenIDStore implementations * shouldn't use this constructor. * + * @access private + * * @param integer $expires_in This is the amount of time this * association is good for, measured in seconds since the * association was issued. diff --git a/Auth/OpenID/BigMath.php b/Auth/OpenID/BigMath.php index f73d876..481275e 100644 --- a/Auth/OpenID/BigMath.php +++ b/Auth/OpenID/BigMath.php @@ -8,15 +8,23 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. * @license http://www.gnu.org/copyleft/lesser.html LGPL */ -// For rand +/** + * Needed for random number generation + */ require_once 'Auth/OpenID/CryptUtil.php'; +/** + * The superclass of all big-integer math implementations + * @access private + * @package OpenID + */ class Auth_OpenID_MathLibrary { /** * Given a long integer, returns the number converted to a binary @@ -165,6 +173,7 @@ class Auth_OpenID_MathLibrary { * Auth_OpenID_BcMathWrapper wraps the functionality provided by the * BCMath extension. * + * @access private * @package OpenID */ class Auth_OpenID_BcMathWrapper extends Auth_OpenID_MathLibrary{ @@ -245,6 +254,7 @@ class Auth_OpenID_BcMathWrapper extends Auth_OpenID_MathLibrary{ * Auth_OpenID_GmpMathWrapper wraps the functionality provided by the * GMP extension. * + * @access private * @package OpenID */ class Auth_OpenID_GmpMathWrapper extends Auth_OpenID_MathLibrary{ diff --git a/Auth/OpenID/Consumer/Parse.php b/Auth/OpenID/Consumer/Parse.php index 69f386f..389e5d5 100644 --- a/Auth/OpenID/Consumer/Parse.php +++ b/Auth/OpenID/Consumer/Parse.php @@ -72,6 +72,7 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. diff --git a/Auth/OpenID/CryptUtil.php b/Auth/OpenID/CryptUtil.php index 24884ae..b949565 100644 --- a/Auth/OpenID/CryptUtil.php +++ b/Auth/OpenID/CryptUtil.php @@ -8,6 +8,7 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. diff --git a/Auth/OpenID/DiffieHellman.php b/Auth/OpenID/DiffieHellman.php index 82208bb..a88489d 100644 --- a/Auth/OpenID/DiffieHellman.php +++ b/Auth/OpenID/DiffieHellman.php @@ -7,6 +7,7 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. @@ -28,6 +29,7 @@ $_Auth_OpenID_DEFAULT_GEN = '2'; * The Diffie-Hellman key exchange class. This class relies on * Auth_OpenID_MathLibrary to perform large number operations. * + * @access private * @package OpenID */ class Auth_OpenID_DiffieHellman { diff --git a/Auth/OpenID/HMACSHA1.php b/Auth/OpenID/HMACSHA1.php index 6bdf97c..6daadb5 100644 --- a/Auth/OpenID/HMACSHA1.php +++ b/Auth/OpenID/HMACSHA1.php @@ -7,6 +7,7 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. diff --git a/Auth/OpenID/KVForm.php b/Auth/OpenID/KVForm.php index 36d3484..3f7c7cf 100644 --- a/Auth/OpenID/KVForm.php +++ b/Auth/OpenID/KVForm.php @@ -7,6 +7,7 @@ * * LICENSE: See the COPYING file included in this distribution. * + * @access private * @package OpenID * @author JanRain, Inc. <openid@janrain.com> * @copyright 2005 Janrain, Inc. @@ -14,6 +15,7 @@ */ /** + * Convert an array into an OpenID colon/newline separated string * @access private */ function Auth_OpenID_arrayToKV($values) @@ -48,6 +50,11 @@ function Auth_OpenID_arrayToKV($values) return $serialized; } +/** + * Convert an OpenID colon/newline separated string into an + * associative array + * @access private + */ function Auth_OpenID_kvToArray($kvs) { $lines = explode("\n", $kvs); diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php index f4b36c9..e9cbc53 100644 --- a/Auth/OpenID/Server.php +++ b/Auth/OpenID/Server.php @@ -42,13 +42,13 @@ class Auth_OpenID_Server { * @param mixed $is_authorized: the name of a callback to use for * determining if a given identity URL should be authorized. * - * @param string $method: The HTTP method of the current + * @param string $method The HTTP method of the current * request. If omitted, $_SERVER['HTTP_METHOD'] will be used. * - * @param array $args: The arguments parsed from the request. If + * @param array $args The arguments parsed from the request. If * omitted, the arguments in the environment will be used. * - * @return array $array: A pair of elements in which the first is + * @return array $array A pair of elements in which the first is * a status code and the meaning of the second depends on the * status. */ diff --git a/Auth/OpenID/Store/SQLStore.php b/Auth/OpenID/Store/SQLStore.php index 0a3671d..2f33a3d 100644 --- a/Auth/OpenID/Store/SQLStore.php +++ b/Auth/OpenID/Store/SQLStore.php @@ -105,6 +105,7 @@ function _unoctify($str) * All methods other than the constructor and createTables should be * considered implementation details. * + * @access private * @package OpenID */ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore { diff --git a/Auth/OpenID/TrustRoot.php b/Auth/OpenID/TrustRoot.php index 66a73ec..173941e 100644 --- a/Auth/OpenID/TrustRoot.php +++ b/Auth/OpenID/TrustRoot.php @@ -2,14 +2,25 @@ /** * Functions for dealing with OpenID trust roots + * + * PHP versions 4 and 5 + * + * LICENSE: See the COPYING file included in this distribution. + * + * @package OpenID + * @author JanRain, Inc. <openid@janrain.com> + * @copyright 2005 Janrain, Inc. + * @license http://www.gnu.org/copyleft/lesser.html LGPL */ /** * Parse a URL into its trust_root parts. * - * @param string $trust_root: The url to parse + * @access private * - * @return mixed $parsed: Either an associative array of trust root + * @param string $trust_root The url to parse + * + * @return mixed $parsed Either an associative array of trust root * parts or false if parsing failed. */ function Auth_OpenID___normalizeTrustRoot($trust_root) @@ -73,6 +84,10 @@ function Auth_OpenID___normalizeTrustRoot($trust_root) return $parts; } +/** + * A regular expression that matches a domain ending in a top-level domains + * @access private + */ define('Auth_OpenID___TLDs', '/\.(com|edu|gov|int|mil|net|org|biz|info|name|museum|coop|aero|ac|' . 'ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|' . @@ -107,9 +122,9 @@ define('Auth_OpenID___TLDs', * the users of the server when a consumer attempts to get the user to * accept a suspicious trust root. * - * @param string $tr: The trust root to check + * @param string $trust_root The trust root to check * - * @return bool $sanity: Whether the trust root looks OK + * @return bool $sanity Whether the trust root looks OK */ function Auth_OpenID_saneTrustRoot($tr) { @@ -117,14 +132,22 @@ function Auth_OpenID_saneTrustRoot($tr) if ($parts === false) { return false; } + + // Localhost is a special case if ($parts['host'] == 'localhost') { return true; } + + // Get the top-level domain of the host. If it is not a valid TLD, + // it's not sane. preg_match(Auth_OpenID___TLDs, $parts['host'], $matches); if (!$matches) { return false; } $tld = $matches[1]; + + // Require at least two levels of specificity for non-country tlds + // and three levels for country tlds. $elements = explode('.', $parts['host']); $n = count($elements); if ($parts['wildcard']) { diff --git a/admin/makedoc.sh b/admin/makedoc.sh index 12ed749..37cd0b1 100644 --- a/admin/makedoc.sh +++ b/admin/makedoc.sh @@ -1,2 +1,5 @@ #!/bin/sh -phpdoc -p -t doc -d Auth -ti "JanRain OpenID Library" -dn "OpenID" -o "HTML:frames:phphtmllib" +set -v +phpdoc -p -t doc -d Auth -ti "JanRain OpenID Library" \ + --ignore \*~ \ + -dn "OpenID" -o "HTML:frames:phphtmllib" |