summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auth/OpenID/BigMath.php21
-rw-r--r--README10
-rw-r--r--admin/texttest.php4
3 files changed, 26 insertions, 9 deletions
diff --git a/Auth/OpenID/BigMath.php b/Auth/OpenID/BigMath.php
index 3113104..c4c75f6 100644
--- a/Auth/OpenID/BigMath.php
+++ b/Auth/OpenID/BigMath.php
@@ -336,14 +336,19 @@ class Auth_OpenID_GmpMathWrapper extends Auth_OpenID_MathLibrary{
* this array.
*/
global $_Auth_OpenID_math_extensions;
-$_Auth_OpenID_math_extensions = array(
- array('modules' => array('gmp', 'php_gmp'),
- 'extension' => 'gmp',
- 'class' => 'Auth_OpenID_GmpMathWrapper'),
- array('modules' => array('bcmath', 'php_bcmath'),
- 'extension' => 'bcmath',
- 'class' => 'Auth_OpenID_BcMathWrapper')
- );
+$_Auth_OpenID_math_extensions = array();
+
+if (!defined('Auth_OpenID_BUGGY_GMP')) {
+ $_Auth_OpenID_math_extensions[] =
+ array('modules' => array('gmp', 'php_gmp'),
+ 'extension' => 'gmp',
+ 'class' => 'Auth_OpenID_GmpMathWrapper');
+}
+
+$_Auth_OpenID_math_extensions[] = array(
+ 'modules' => array('bcmath', 'php_bcmath'),
+ 'extension' => 'bcmath',
+ 'class' => 'Auth_OpenID_BcMathWrapper');
/**
* Detect which (if any) math library is available
diff --git a/README b/README
index 70960b9..fc58d8d 100644
--- a/README
+++ b/README
@@ -75,13 +75,21 @@ examples/README file for more details.
TROUBLESHOOTING
===============
-On some systems, PHP basedir restrictions prevent web servers from
+* On some systems, PHP basedir restrictions prevent web servers from
opening a source of randomness, such as /dev/urandom. If your PHP
OpenID library has trouble getting a satisfactory source of
randomness, check your Apache and PHP configurations to be sure that
the randomness source is in the list of allowed paths for the
"open_basedir" option.
+* In some cases, bugs in the GMP math library will result in signature
+validation errors when using this library. Since GMP is preferred
+over bcmath (for performance), you will have to define
+Auth_OpenID_BUGGY_GMP in your application *before* importing any of
+the library code:
+
+ define('Auth_OpenID_BUGGY_GMP', true);
+
GETTING HELP
============
diff --git a/admin/texttest.php b/admin/texttest.php
index bb01eee..c2945f7 100644
--- a/admin/texttest.php
+++ b/admin/texttest.php
@@ -45,6 +45,7 @@ function microtime_float()
}
$longopts = array('no-math',
+ 'buggy-gmp',
'no-curl',
'math-lib=',
'insecure-rand',
@@ -73,6 +74,9 @@ foreach ($flags as $flag) {
case '--no-math':
define('Auth_OpenID_NO_MATH_SUPPORT', true);
break;
+ case '--buggy-gmp':
+ define('Auth_OpenID_BUGGY_GMP', true);
+ break;
case '--no-curl':
define('Auth_Yadis_CURL_OVERRIDE', true);
break;