We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 17b8020d authored by James Walker's avatar James Walker

clean up error logging

parent cd561657
...@@ -89,7 +89,7 @@ class Magicsig extends Memcached_DataObject ...@@ -89,7 +89,7 @@ class Magicsig extends Memcached_DataObject
return parent::insert(); return parent::insert();
} }
public function generate($key_length = 512) public function generate($key_length = 512)
{ {
PEAR::pushErrorHandling(PEAR_ERROR_RETURN); PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
...@@ -143,15 +143,15 @@ class Magicsig extends Memcached_DataObject ...@@ -143,15 +143,15 @@ class Magicsig extends Memcached_DataObject
$params['public_key'] = new Crypt_RSA_KEY($mod, $exp, 'public'); $params['public_key'] = new Crypt_RSA_KEY($mod, $exp, 'public');
if ($params['public_key']->isError()) { if ($params['public_key']->isError()) {
$error = $params['public_key']->getLastError(); $error = $params['public_key']->getLastError();
print $error->getMessage(); common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
exit; return false;
} }
if ($private_exp) { if ($private_exp) {
$params['private_key'] = new Crypt_RSA_KEY($mod, $private_exp, 'private'); $params['private_key'] = new Crypt_RSA_KEY($mod, $private_exp, 'private');
if ($params['private_key']->isError()) { if ($params['private_key']->isError()) {
$error = $params['private_key']->getLastError(); $error = $params['private_key']->getLastError();
print $error->getMessage(); common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
exit; return false;
} }
} }
...@@ -182,6 +182,7 @@ class Magicsig extends Memcached_DataObject ...@@ -182,6 +182,7 @@ class Magicsig extends Memcached_DataObject
if ($this->_rsa->isError()) { if ($this->_rsa->isError()) {
$error = $this->_rsa->getLastError(); $error = $this->_rsa->getLastError();
common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage()); common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
return false;
} }
return $sig; return $sig;
...@@ -192,8 +193,8 @@ class Magicsig extends Memcached_DataObject ...@@ -192,8 +193,8 @@ class Magicsig extends Memcached_DataObject
$result = $this->_rsa->validateSign($signed_bytes, $signature, null, 'sha256'); $result = $this->_rsa->validateSign($signed_bytes, $signature, null, 'sha256');
if ($this->_rsa->isError()) { if ($this->_rsa->isError()) {
$error = $this->keypair->getLastError(); $error = $this->keypair->getLastError();
//common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage()); common_log(LOG_DEBUG, 'RSA Error: '. $error->getMessage());
print $error->getMessage(); return false;
} }
return $result; return $result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment