|
|
@ -40,6 +40,7 @@ class enigma_driver_gnupg extends enigma_driver
|
|
|
|
function init()
|
|
|
|
function init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$homedir = $this->rc->config->get('enigma_pgp_homedir', INSTALL_PATH . 'plugins/enigma/home');
|
|
|
|
$homedir = $this->rc->config->get('enigma_pgp_homedir', INSTALL_PATH . 'plugins/enigma/home');
|
|
|
|
|
|
|
|
$debug = $this->rc->config->get('enigma_debug');
|
|
|
|
|
|
|
|
|
|
|
|
if (!$homedir)
|
|
|
|
if (!$homedir)
|
|
|
|
return new enigma_error(enigma_error::INTERNAL,
|
|
|
|
return new enigma_error(enigma_error::INTERNAL,
|
|
|
@ -73,7 +74,7 @@ class enigma_driver_gnupg extends enigma_driver
|
|
|
|
$this->gpg = new Crypt_GPG(array(
|
|
|
|
$this->gpg = new Crypt_GPG(array(
|
|
|
|
'homedir' => $this->homedir,
|
|
|
|
'homedir' => $this->homedir,
|
|
|
|
// 'binary' => '/usr/bin/gpg2',
|
|
|
|
// 'binary' => '/usr/bin/gpg2',
|
|
|
|
// 'debug' => true,
|
|
|
|
'debug' => $debug ? array($this, 'debug') : false,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception $e) {
|
|
|
|
catch (Exception $e) {
|
|
|
@ -257,10 +258,11 @@ class enigma_driver_gnupg extends enigma_driver
|
|
|
|
public function gen_key($data)
|
|
|
|
public function gen_key($data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
$debug = $this->rc->config->get('enigma_debug');
|
|
|
|
$keygen = new Crypt_GPG_KeyGenerator(array(
|
|
|
|
$keygen = new Crypt_GPG_KeyGenerator(array(
|
|
|
|
'homedir' => $this->homedir,
|
|
|
|
'homedir' => $this->homedir,
|
|
|
|
// 'binary' => '/usr/bin/gpg2',
|
|
|
|
// 'binary' => '/usr/bin/gpg2',
|
|
|
|
// 'debug' => true,
|
|
|
|
'debug' => $debug ? array($this, 'debug') : false,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
$key = $keygen
|
|
|
|
$key = $keygen
|
|
|
@ -441,4 +443,12 @@ class enigma_driver_gnupg extends enigma_driver
|
|
|
|
|
|
|
|
|
|
|
|
return $ekey;
|
|
|
|
return $ekey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Write debug info from Crypt_GPG to logs/enigma
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function debug($line)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rcube::write_log('enigma', 'GPG: ' . $line);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|