Further cleanup of files_encryption
This commit is contained in:
parent
00338f9dca
commit
dbdd754c3f
|
@ -25,9 +25,6 @@ namespace OCA\Encryption\Crypto;
|
||||||
use OC\Encryption\Exceptions\DecryptionFailedException;
|
use OC\Encryption\Exceptions\DecryptionFailedException;
|
||||||
use OC\Encryption\Exceptions\EncryptionFailedException;
|
use OC\Encryption\Exceptions\EncryptionFailedException;
|
||||||
use OC\Encryption\Exceptions\GenericEncryptionException;
|
use OC\Encryption\Exceptions\GenericEncryptionException;
|
||||||
use OCA\Encryption\KeyManager;
|
|
||||||
use OCA\Files_Encryption\Exception\MultiKeyDecryptException;
|
|
||||||
use OCA\Files_Encryption\Exception\MultiKeyEncryptException;
|
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
@ -35,11 +32,6 @@ use OCP\IUserSession;
|
||||||
|
|
||||||
class Crypt {
|
class Crypt {
|
||||||
|
|
||||||
const ENCRYPTION_UKNOWN_ERROR = -1;
|
|
||||||
const ENCRYPTION_NOT_INIALIZED_ERROR = 1;
|
|
||||||
const ENCRYPTIION_PRIVATE_KEY_NOT_VALID_ERROR = 2;
|
|
||||||
const ENCRYPTION_NO_SHARE_KEY_FOUND = 3;
|
|
||||||
|
|
||||||
const BLOCKSIZE = 8192;
|
const BLOCKSIZE = 8192;
|
||||||
const DEFAULT_CIPHER = 'AES-256-CFB';
|
const DEFAULT_CIPHER = 'AES-256-CFB';
|
||||||
|
|
||||||
|
@ -97,7 +89,7 @@ class Crypt {
|
||||||
'privateKey' => $privateKey
|
'privateKey' => $privateKey
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$log->error('Encryption library couldn\'t export users private key, please check your servers openSSL configuration.' . $user->getUID(),
|
$log->error('Encryption library couldn\'t export users private key, please check your servers openSSL configuration.' . $this->user->getUID(),
|
||||||
['app' => 'encryption']);
|
['app' => 'encryption']);
|
||||||
if (openssl_error_string()) {
|
if (openssl_error_string()) {
|
||||||
$log->error('Encryption Library:' . openssl_error_string(),
|
$log->error('Encryption Library:' . openssl_error_string(),
|
||||||
|
|
|
@ -166,7 +166,7 @@ if (isset($argv[1])) {
|
||||||
} else {
|
} else {
|
||||||
$licenses->exec([
|
$licenses->exec([
|
||||||
'../apps/files',
|
'../apps/files',
|
||||||
'../apps/files_encryption',
|
'../apps/encryption',
|
||||||
'../apps/files_external',
|
'../apps/files_external',
|
||||||
'../apps/files_sharing',
|
'../apps/files_sharing',
|
||||||
'../apps/files_trashbin',
|
'../apps/files_trashbin',
|
||||||
|
|
|
@ -743,9 +743,6 @@ class OC {
|
||||||
);
|
);
|
||||||
\OCP\Util::connectHook('OCP\Share', 'post_shared', $updater, 'postShared');
|
\OCP\Util::connectHook('OCP\Share', 'post_shared', $updater, 'postShared');
|
||||||
\OCP\Util::connectHook('OCP\Share', 'post_unshare', $updater, 'postUnshared');
|
\OCP\Util::connectHook('OCP\Share', 'post_unshare', $updater, 'postUnshared');
|
||||||
|
|
||||||
//\OCP\Util::connectHook('OC_Filesystem', 'post_umount', 'OCA\Files_Encryption\Hooks', 'postUnmount');
|
|
||||||
//\OCP\Util::connectHook('OC_Filesystem', 'umount', 'OCA\Files_Encryption\Hooks', 'preUnmount');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ class OC_App {
|
||||||
self::$shippedApps = json_decode(file_get_contents($shippedJson), true);
|
self::$shippedApps = json_decode(file_get_contents($shippedJson), true);
|
||||||
self::$shippedApps = self::$shippedApps['shippedApps'];
|
self::$shippedApps = self::$shippedApps['shippedApps'];
|
||||||
} else {
|
} else {
|
||||||
self::$shippedApps = ['files', 'files_encryption', 'files_external',
|
self::$shippedApps = ['files', 'encryption', 'files_external',
|
||||||
'files_sharing', 'files_trashbin', 'files_versions', 'provisioning_api',
|
'files_sharing', 'files_trashbin', 'files_versions', 'provisioning_api',
|
||||||
'user_ldap', 'user_webdavauth'];
|
'user_ldap', 'user_webdavauth'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
namespace OC\Connector\Sabre;
|
namespace OC\Connector\Sabre;
|
||||||
|
|
||||||
|
use OC\Encryption\Exceptions\GenericEncryptionException;
|
||||||
|
|
||||||
class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
|
class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,7 +127,7 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
|
||||||
} catch (\OCP\Files\LockNotAcquiredException $e) {
|
} catch (\OCP\Files\LockNotAcquiredException $e) {
|
||||||
// the file is currently being written to by another process
|
// the file is currently being written to by another process
|
||||||
throw new \OC\Connector\Sabre\Exception\FileLocked($e->getMessage(), $e->getCode(), $e);
|
throw new \OC\Connector\Sabre\Exception\FileLocked($e->getMessage(), $e->getCode(), $e);
|
||||||
} catch (\OCA\Files_Encryption\Exception\EncryptionException $e) {
|
} catch (GenericEncryptionException $e) {
|
||||||
throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
|
throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
|
||||||
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
||||||
throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to write file contents: ".$e->getMessage());
|
throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to write file contents: ".$e->getMessage());
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
namespace OC\Encryption\Keys;
|
namespace OC\Encryption\Keys;
|
||||||
|
|
||||||
|
use OC\Encryption\Exceptions\GenericEncryptionException;
|
||||||
use OC\Encryption\Util;
|
use OC\Encryption\Util;
|
||||||
use OC\Files\View;
|
use OC\Files\View;
|
||||||
use OCA\Files_Encryption\Exception\EncryptionException;
|
|
||||||
|
|
||||||
class Storage implements \OCP\Encryption\Keys\IStorage {
|
class Storage implements \OCP\Encryption\Keys\IStorage {
|
||||||
|
|
||||||
|
@ -253,13 +253,13 @@ class Storage implements \OCP\Encryption\Keys\IStorage {
|
||||||
*
|
*
|
||||||
* @param string $path path to the file, relative to data/
|
* @param string $path path to the file, relative to data/
|
||||||
* @return string
|
* @return string
|
||||||
* @throws EncryptionException
|
* @throws GenericEncryptionException
|
||||||
* @internal param string $keyId
|
* @internal param string $keyId
|
||||||
*/
|
*/
|
||||||
private function getFileKeyDir($path) {
|
private function getFileKeyDir($path) {
|
||||||
|
|
||||||
if ($this->view->is_dir($path)) {
|
if ($this->view->is_dir($path)) {
|
||||||
throw new EncryptionException('file was expected but directory was given', EncryptionException::GENERIC);
|
throw new GenericEncryptionException('file was expected but directory was given');
|
||||||
}
|
}
|
||||||
|
|
||||||
list($owner, $filename) = $this->util->getUidAndFilename($path);
|
list($owner, $filename) = $this->util->getUidAndFilename($path);
|
||||||
|
|
|
@ -18,7 +18,6 @@ function enableApp($app) {
|
||||||
|
|
||||||
enableApp('files_sharing');
|
enableApp('files_sharing');
|
||||||
enableApp('files_trashbin');
|
enableApp('files_trashbin');
|
||||||
enableApp('files_encryption');
|
|
||||||
enableApp('encryption');
|
enableApp('encryption');
|
||||||
enableApp('user_ldap');
|
enableApp('user_ldap');
|
||||||
enableApp('files_versions');
|
enableApp('files_versions');
|
||||||
|
|
Loading…
Reference in New Issue