Magicsig call for phpseclib\Math\BigInteger fixed

This commit is contained in:
Mikael Nordfeldth 2016-06-17 23:47:00 +02:00
parent 1839082f95
commit 3a8ce99a9d

View File

@ -27,11 +27,7 @@
* @link http://status.net/ * @link http://status.net/
*/ */
if (!defined('STATUSNET')) { if (!defined('GNUSOCIAL')) { exit(1); }
exit(1);
}
require_once 'Crypt/RSA.php';
class Magicsig extends Managed_DataObject class Magicsig extends Managed_DataObject
{ {
@ -251,9 +247,9 @@ class Magicsig extends Managed_DataObject
{ {
$rsa = new \phpseclib\Crypt\RSA(); $rsa = new \phpseclib\Crypt\RSA();
$rsa->setHash($this->getHash()); $rsa->setHash($this->getHash());
$rsa->modulus = new Math_BigInteger(Magicsig::base64_url_decode($mod), 256); $rsa->modulus = new \phpseclib\Math\BigInteger(Magicsig::base64_url_decode($mod), 256);
$rsa->k = strlen($rsa->modulus->toBytes()); $rsa->k = strlen($rsa->modulus->toBytes());
$rsa->exponent = new Math_BigInteger(Magicsig::base64_url_decode($exp), 256); $rsa->exponent = new \phpseclib\Math\BigInteger(Magicsig::base64_url_decode($exp), 256);
if ($type == 'private') { if ($type == 'private') {
$this->privateKey = $rsa; $this->privateKey = $rsa;