summaryrefslogtreecommitdiffstats
path: root/lib/private/encryption/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/encryption/exceptions')
-rw-r--r--lib/private/encryption/exceptions/decryptionfailedexception.php29
-rw-r--r--lib/private/encryption/exceptions/emptyencryptiondataexception.php29
-rw-r--r--lib/private/encryption/exceptions/encryptionfailedexception.php29
-rw-r--r--lib/private/encryption/exceptions/encryptionheaderkeyexistsexception.php11
-rw-r--r--lib/private/encryption/exceptions/encryptionheadertolargeexception.php33
-rw-r--r--lib/private/encryption/exceptions/modulealreadyexistsexception.php12
-rw-r--r--lib/private/encryption/exceptions/moduledoesnotexistsexception.php4
-rw-r--r--lib/private/encryption/exceptions/unknowncipherexception.php29
8 files changed, 172 insertions, 4 deletions
diff --git a/lib/private/encryption/exceptions/decryptionfailedexception.php b/lib/private/encryption/exceptions/decryptionfailedexception.php
new file mode 100644
index 00000000000..f8b4fdf07fa
--- /dev/null
+++ b/lib/private/encryption/exceptions/decryptionfailedexception.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * @author Clark Tomlinson <clark@owncloud.com>
+ * @since 2/25/15, 9:38 AM
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class DecryptionFailedException extends GenericEncryptionException {
+
+}
diff --git a/lib/private/encryption/exceptions/emptyencryptiondataexception.php b/lib/private/encryption/exceptions/emptyencryptiondataexception.php
new file mode 100644
index 00000000000..d3dc9230047
--- /dev/null
+++ b/lib/private/encryption/exceptions/emptyencryptiondataexception.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * @author Clark Tomlinson <clark@owncloud.com>
+ * @since 2/25/15, 9:38 AM
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class EmptyEncryptionDataException extends GenericEncryptionException{
+
+}
diff --git a/lib/private/encryption/exceptions/encryptionfailedexception.php b/lib/private/encryption/exceptions/encryptionfailedexception.php
new file mode 100644
index 00000000000..ac489c73254
--- /dev/null
+++ b/lib/private/encryption/exceptions/encryptionfailedexception.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * @author Clark Tomlinson <clark@owncloud.com>
+ * @since 2/25/15, 9:37 AM
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class EncryptionFailedException extends GenericEncryptionException{
+
+}
diff --git a/lib/private/encryption/exceptions/encryptionheaderkeyexistsexception.php b/lib/private/encryption/exceptions/encryptionheaderkeyexistsexception.php
index d401f0323ba..5e8e48efd78 100644
--- a/lib/private/encryption/exceptions/encryptionheaderkeyexistsexception.php
+++ b/lib/private/encryption/exceptions/encryptionheaderkeyexistsexception.php
@@ -23,7 +23,14 @@
namespace OC\Encryption\Exceptions;
+use OCP\Encryption\Exceptions\GenericEncryptionException;
-class EncryptionHeaderKeyExistsException extends \Exception {
+class EncryptionHeaderKeyExistsException extends GenericEncryptionException {
-} \ No newline at end of file
+ /**
+ * @param string $key
+ */
+ public function __construct($key) {
+ parent::__construct('header key "'. $key . '" already reserved by ownCloud');
+ }
+}
diff --git a/lib/private/encryption/exceptions/encryptionheadertolargeexception.php b/lib/private/encryption/exceptions/encryptionheadertolargeexception.php
new file mode 100644
index 00000000000..cdb5f940800
--- /dev/null
+++ b/lib/private/encryption/exceptions/encryptionheadertolargeexception.php
@@ -0,0 +1,33 @@
+<?php
+ /**
+ * @author Clark Tomlinson <clark@owncloud.com>
+ * @since 2/25/15, 9:35 AM
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class EncryptionHeaderToLargeException extends GenericEncryptionException {
+
+ public function __construct() {
+ parent::__construct('max header size exceeded');
+ }
+
+}
diff --git a/lib/private/encryption/exceptions/modulealreadyexistsexception.php b/lib/private/encryption/exceptions/modulealreadyexistsexception.php
index 41fc0188e24..fa1e70a5c36 100644
--- a/lib/private/encryption/exceptions/modulealreadyexistsexception.php
+++ b/lib/private/encryption/exceptions/modulealreadyexistsexception.php
@@ -23,6 +23,16 @@
namespace OC\Encryption\Exceptions;
-class ModuleAlreadyExistsException extends \Exception {
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class ModuleAlreadyExistsException extends GenericEncryptionException {
+
+ /**
+ * @param string $id
+ * @param string $name
+ */
+ public function __construct($id, $name) {
+ parent::__construct('Id "' . $id . '" already used by encryption module "' . $name . '"');
+ }
}
diff --git a/lib/private/encryption/exceptions/moduledoesnotexistsexception.php b/lib/private/encryption/exceptions/moduledoesnotexistsexception.php
index 5507bd03dab..2c699e8dc2d 100644
--- a/lib/private/encryption/exceptions/moduledoesnotexistsexception.php
+++ b/lib/private/encryption/exceptions/moduledoesnotexistsexception.php
@@ -23,6 +23,8 @@
namespace OC\Encryption\Exceptions;
-class ModuleDoesNotExistsException extends \Exception {
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class ModuleDoesNotExistsException extends GenericEncryptionException {
}
diff --git a/lib/private/encryption/exceptions/unknowncipherexception.php b/lib/private/encryption/exceptions/unknowncipherexception.php
new file mode 100644
index 00000000000..188f7403848
--- /dev/null
+++ b/lib/private/encryption/exceptions/unknowncipherexception.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * @author Clark Tomlinson <clark@owncloud.com>
+ * @since 2/25/15, 9:36 AM
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class UnknownCipherException extends GenericEncryptionException {
+
+}