summaryrefslogtreecommitdiff
path: root/plugins/OStatus/classes/Magicsig.php
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-02-22 23:30:05 -0500
committerJames Walker <walkah@walkah.net>2010-02-22 23:30:31 -0500
commit17b8020d2585ce248d12ad1a2b8f57a4ab250f82 (patch)
treeeacf0a9958c307f9c534953f948124808799a5fa /plugins/OStatus/classes/Magicsig.php
parentcd561657c2bea873f6916cec0e957a9973fa990e (diff)
clean up error logging
Diffstat (limited to 'plugins/OStatus/classes/Magicsig.php')
-rw-r--r--plugins/OStatus/classes/Magicsig.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/OStatus/classes/Magicsig.php b/plugins/OStatus/classes/Magicsig.php
index 85664bbf9..c9f6182b5 100644
--- a/plugins/OStatus/classes/Magicsig.php
+++ b/plugins/OStatus/classes/Magicsig.php
@@ -89,7 +89,7 @@ class Magicsig extends Memcached_DataObject
return parent::insert();
}
-
+
public function generate($key_length = 512)
{
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
@@ -143,15 +143,15 @@ class Magicsig extends Memcached_DataObject
$params['public_key'] = new Crypt_RSA_KEY($mod, $exp, 'public');
if ($params['public_key']->isError()) {
$error = $params['public_key']->getLastError();
- print $error->getMessage();
- exit;
+ common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
+ return false;
}
if ($private_exp) {
$params['private_key'] = new Crypt_RSA_KEY($mod, $private_exp, 'private');
if ($params['private_key']->isError()) {
$error = $params['private_key']->getLastError();
- print $error->getMessage();
- exit;
+ common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
+ return false;
}
}
@@ -182,6 +182,7 @@ class Magicsig extends Memcached_DataObject
if ($this->_rsa->isError()) {
$error = $this->_rsa->getLastError();
common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
+ return false;
}
return $sig;
@@ -192,8 +193,8 @@ class Magicsig extends Memcached_DataObject
$result = $this->_rsa->validateSign($signed_bytes, $signature, null, 'sha256');
if ($this->_rsa->isError()) {
$error = $this->keypair->getLastError();
- //common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
- print $error->getMessage();
+ common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
+ return false;
}
return $result;
}