]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/OStatus/lib/safecrypt_rsa.php
Math_BigInteger doesn't correctly handle serialization/deserialization for a value...
[quix0rs-gnu-social.git] / plugins / OStatus / lib / safecrypt_rsa.php
1 <?php
2
3 require_once 'Crypt/RSA.php';
4
5 /**
6  * Crypt_RSA stores a Math_BigInteger with value 0, which triggers a bug
7  * in Math_BigInteger's wakeup function which spews notices to log or output.
8  * This wrapper replaces it with a version that survives serialization.
9  */
10 class SafeCrypt_RSA extends Crypt_RSA
11 {
12     function __construct()
13     {
14         parent::__construct();
15         $this->zero = new SafeMath_BigInteger();
16     }
17 }
18