summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Perry <matt@mattperry.com>2013-08-22 15:10:59 -0700
committerMatt Perry <matt@mattperry.com>2013-08-22 15:10:59 -0700
commitbb1c4a6542e957379b606ddff38f5c84270d62bc (patch)
tree3312ca6e1130bb449fcbaf444ed1c47abb692ab4
parent3bd5bd97dce4baed3305e5142998159820f4ff25 (diff)
downloadrpg-bb1c4a6542e957379b606ddff38f5c84270d62bc.tar.gz
rpg-bb1c4a6542e957379b606ddff38f5c84270d62bc.tar.bz2
Revert changes to phpseclib to previous commit
Michael Hamann commented in pull request #306 that phpseclib has not been adopted by the DokuWiki project. Therefore, the changes made to reduce the CodeSniffer violations should be reverted and the local copy of phpseclib should be excluded from CS checks. This commit reverts the previous changes and adds the appropriate exclusion rule.
-rw-r--r--_cs/DokuWiki/ruleset.xml1
-rw-r--r--inc/phpseclib/Crypt_Hash.php10
-rw-r--r--inc/phpseclib/Math_BigInteger.php38
3 files changed, 25 insertions, 24 deletions
diff --git a/_cs/DokuWiki/ruleset.xml b/_cs/DokuWiki/ruleset.xml
index fc6f5f8d3..33c42cd5e 100644
--- a/_cs/DokuWiki/ruleset.xml
+++ b/_cs/DokuWiki/ruleset.xml
@@ -4,6 +4,7 @@
<!-- ignore 3rd party libraries (that we haven't adopted) -->
<exclude-pattern>*/inc/lessc.inc.php</exclude-pattern>
+ <exclude-pattern>*/inc/phpseclib/*</exclude-pattern>
<exclude-pattern>*/lib/plugins/authad/adLDAP/*</exclude-pattern>
<exclude-pattern>*/lib/scripts/jquery/*</exclude-pattern>
<exclude-pattern>*/EmailAddressValidator.php</exclude-pattern>
diff --git a/inc/phpseclib/Crypt_Hash.php b/inc/phpseclib/Crypt_Hash.php
index eaa2da239..840fcd508 100644
--- a/inc/phpseclib/Crypt_Hash.php
+++ b/inc/phpseclib/Crypt_Hash.php
@@ -13,7 +13,7 @@
*
* PHP versions 4 and 5
*
- * {@internal The variable names are the same as those in
+ * {@internal The variable names are the same as those in
* {@link http://tools.ietf.org/html/rfc2104#section-2 RFC2104}.}}
*
* Here's a short example of how to use this library:
@@ -35,10 +35,10 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -567,11 +567,11 @@ class Crypt_Hash {
if (!isset($k)) {
// Initialize variables
$init384 = array( // initial values for SHA384
- 'cbbb9d5dc1059ed8', '629a292a367cd507', '9159015a3070dd17', '152fecd8f70e5939',
+ 'cbbb9d5dc1059ed8', '629a292a367cd507', '9159015a3070dd17', '152fecd8f70e5939',
'67332667ffc00b31', '8eb44a8768581511', 'db0c2e0d64f98fa7', '47b5481dbefa4fa4'
);
$init512 = array( // initial values for SHA512
- '6a09e667f3bcc908', 'bb67ae8584caa73b', '3c6ef372fe94f82b', 'a54ff53a5f1d36f1',
+ '6a09e667f3bcc908', 'bb67ae8584caa73b', '3c6ef372fe94f82b', 'a54ff53a5f1d36f1',
'510e527fade682d1', '9b05688c2b3e6c1f', '1f83d9abfb41bd6b', '5be0cd19137e2179'
);
diff --git a/inc/phpseclib/Math_BigInteger.php b/inc/phpseclib/Math_BigInteger.php
index 55379770d..a37662da9 100644
--- a/inc/phpseclib/Math_BigInteger.php
+++ b/inc/phpseclib/Math_BigInteger.php
@@ -9,7 +9,7 @@
*
* PHP versions 4 and 5
*
- * {@internal (all DocBlock comments regarding implementation - such as the one that follows - refer to the
+ * {@internal (all DocBlock comments regarding implementation - such as the one that follows - refer to the
* {@link MATH_BIGINTEGER_MODE_INTERNAL MATH_BIGINTEGER_MODE_INTERNAL} mode)
*
* Math_BigInteger uses base-2**26 to perform operations such as multiplication and division and
@@ -53,10 +53,10 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -223,7 +223,7 @@ class Math_BigInteger {
/**
* Mode independent value used for serialization.
*
- * If the bcmath or gmp extensions are installed $this->value will be a non-serializable resource, hence the need for
+ * If the bcmath or gmp extensions are installed $this->value will be a non-serializable resource, hence the need for
* a variable that'll be serializable regardless of whether or not extensions are being used. Unlike $this->value,
* however, $this->hex is only calculated when $this->__sleep() is called.
*
@@ -774,7 +774,7 @@ class Math_BigInteger {
$vars[] = 'precision';
}
return $vars;
-
+
}
/**
@@ -2256,7 +2256,7 @@ class Math_BigInteger {
/**
* Montgomery Multiply
*
- * Interleaves the montgomery reduction and long multiplication algorithms together as described in
+ * Interleaves the montgomery reduction and long multiplication algorithms together as described in
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=13 HAC 14.36}
*
* @see _prepMontgomery()
@@ -2336,7 +2336,7 @@ class Math_BigInteger {
* {@link http://groups.google.com/group/sci.crypt/msg/7a137205c1be7d85}
*
* As for why we do all the bitmasking... strange things can happen when converting from floats to ints. For
- * instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields
+ * instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields
* int(-2147483648). To avoid problems stemming from this, we use bitmasks to guarantee that ints aren't
* auto-converted to floats. The outermost bitmask is present because without it, there's no guarantee that
* the "residue" returned would be the so-called "common residue". We use fmod, in the last step, because the
@@ -3237,7 +3237,7 @@ class Math_BigInteger {
* @return Boolean
* @access public
* @internal Uses the
- * {@link http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test Miller-Rabin primality test}. See
+ * {@link http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test Miller-Rabin primality test}. See
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=8 HAC 4.24}.
*/
function isPrime($t = false)
@@ -3246,7 +3246,7 @@ class Math_BigInteger {
if (!$t) {
// see HAC 4.49 "Note (controlling the error probability)"
- if ($length >= 163) { $t = 2; } // floor(1300 / 8)
+ if ($length >= 163) { $t = 2; } // floor(1300 / 8)
else if ($length >= 106) { $t = 3; } // floor( 850 / 8)
else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8)
else if ($length >= 68 ) { $t = 5; } // floor( 550 / 8)
@@ -3286,16 +3286,16 @@ class Math_BigInteger {
if (!isset($primes)) {
$primes = array(
- 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
- 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137,
- 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227,
- 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
- 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
- 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509,
- 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617,
- 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727,
- 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829,
- 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947,
+ 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
+ 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137,
+ 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227,
+ 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
+ 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
+ 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509,
+ 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617,
+ 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727,
+ 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829,
+ 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947,
953, 967, 971, 977, 983, 991, 997
);