]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
swapping pear error handling so Crypt_RSA can properly detect available
authorJames Walker <walkah@walkah.net>
Tue, 23 Feb 2010 00:00:27 +0000 (19:00 -0500)
committerJames Walker <walkah@walkah.net>
Tue, 23 Feb 2010 00:01:12 +0000 (19:01 -0500)
math libraries

plugins/OStatus/lib/magicsig.php

index af65bad046594bb09165ddb7a06f8956e6d5d6ab..50eb301ab3d7b4bdf2037e54ebc801f3d325221b 100644 (file)
@@ -57,8 +57,10 @@ class MagicsigRsaSha256
         $keypair = new Crypt_RSA_KeyPair($key_length);
         $params['public_key'] = $keypair->getPublicKey();
         $params['private_key'] = $keypair->getPrivateKey();
-        
+
+        PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
         $this->keypair = new Crypt_RSA($params);
+        PEAR::popErrorHandling();
     }
 
 
@@ -79,6 +81,8 @@ class MagicsigRsaSha256
     
     public function fromString($text)
     {
+        PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
+
         // remove whitespace
         $text = preg_replace('/\s+/', '', $text);
 
@@ -86,7 +90,6 @@ class MagicsigRsaSha256
         if (!preg_match('/RSA\.([^\.]+)\.([^\.]+)(.([^\.]+))?/', $text, $matches)) {
             return false;
         }
-
         
         $mod = base64_url_decode($matches[1]);
         $exp = base64_url_decode($matches[2]);
@@ -110,6 +113,7 @@ class MagicsigRsaSha256
         }
 
         $this->keypair = new Crypt_RSA($params);
+        PEAR::popErrorHandling();
     }
 
     public function getName()