Commit Graph

678 Commits

Author SHA1 Message Date
Lukas Reschke 2d2a4741ce Make files non executable
There is not much sense in having these files marked executable, we should avoid that.
2014-10-24 11:14:51 +02:00
jknockaert da44150a15 small fix 2014-10-20 23:25:54 +02:00
jknockaert d277ef6ac2 bugfixes 2014-10-20 23:04:11 +02:00
Jörn Friedrich Dreyer cb3a4d22b1 make tests compatible with hook based skeleton generation 2014-10-20 11:29:20 +02:00
jknockaert 1b7e9d66b3 ok; still some bugs that had to be fixed 2014-10-20 00:28:41 +02:00
jknockaert 3be57d0169 small fix 2014-10-19 22:54:34 +02:00
jknockaert e318858152 rework getFileSize 2014-10-19 22:27:15 +02:00
Thomas Müller d37eee09a5 fixing usage of EncryptionException 2014-10-17 11:46:22 +02:00
Bjoern Schiessle 9147219377 we also encrypt/decrypt files in the versions folder for previews and if encryption is enabled/disabled 2014-10-06 12:02:08 +02:00
Vincent Petry 75593f87d5 Merge pull request #11137 from owncloud/enc-pregfix
Fix share key pattern matching
2014-09-23 12:36:34 +02:00
Vincent Petry 1e631754d7 Fix share key finding algorithm in various cases
Instead of inaccurate pattern matching, use the list of users who we
know have access to the file to build the list of share keys.

This covers the following cases:

- Move/copy files into a subfolder within a share
- Unsharing from a user
- Deleting files directlry / moving share keys to trashbin
2014-09-23 12:33:07 +02:00
Volkan Gezer 01808c8c84 fix typo 2014-09-19 18:22:09 +02:00
Bjoern Schiessle a280859bf8 make sure that we really catch the files folder only 2014-09-19 11:47:18 +02:00
Bjoern Schiessle 2ee14c4734 create backup from all keys before recovery 2014-09-19 11:47:18 +02:00
Vincent Petry da9f9ae9b3 Remove passing by reference to allow for proper GC
The garbage collector in PHP 5.3.10 does not properly release the file
handle when calling fclose() due to the fact that it is passed by
reference.
This has the side-effect of preventing file locks to be released as well
when the files_locking app is enabled.

This fix removes the useless passing by reference and now the file
handle and file lock are freed properly.
2014-09-12 19:51:47 +02:00
Jörn Friedrich Dreyer f551917a3c kill OC::$session
maintain deprecated \OC::$session when getting or setting the session via the server container or UserSession

restore order os OC::$session and OC::$CLI

remove unneded initialization of dummy session

write back session when $useCustomSession is true

log warning when deprecated app is used
2014-08-29 10:22:21 +02:00
Vincent Petry f282a5cff0 Merge pull request #9754 from owncloud/enc_support_aes_256
[encryption] support aes 256
2014-08-13 12:34:21 +02:00
Bjoern Schiessle da1feafc78 fix detection of system wide mount points 2014-08-12 21:14:22 +02:00
Bjoern Schiessle 0b3ddbed68 add logout hook to remove keys from session 2014-08-07 15:29:35 +02:00
Bjoern Schiessle c738f71657 make the versions and encryption app aware of the copy operation 2014-07-30 15:14:01 +02:00
Bjoern Schiessle de9d3797ff update existing unit tests 2014-07-23 12:14:02 +02:00
Bjoern Schiessle 4bbdcfbccf support aes 256 2014-07-23 12:14:01 +02:00
Bjoern Schiessle 8105f2ac8a introduce some encryption exceptions and catch additional error cases 2014-07-16 12:36:30 +02:00
Thomas Müller 064ac77e44 Kill legacy encryption migration 2014-07-08 13:07:05 +02:00
Frank Karlitschek a468687682 Merge pull request #9453 from owncloud/enc_fix_wrong_file_size
[encryption] always take unencrypted size
2014-07-06 10:38:06 -04:00
Bjoern Schiessle ddac446c5b always take unencrypted size 2014-07-04 16:44:50 +02:00
Bjoern Schiessle 673b0f5eb9 add owner as parameter for delShareKey 2014-07-04 12:19:59 +02:00
Björn Schießle f3973c1c20 Merge pull request #9240 from owncloud/enc_check_if_file_exists
[encryption] check if file still exists before removing encryption keys
2014-06-30 21:23:59 +02:00
Bjoern Schiessle 618c9fd033 improved error message 2014-06-30 16:28:40 +02:00
Bjoern Schiessle e4c45b5e26 check if file exists before deleting keys, and add debug output for every
delete operation
2014-06-27 23:09:31 +02:00
Bjoern Schiessle 706a8ace58 normalize path before comparison to make sure that we always find the mount point 2014-06-27 22:53:26 +02:00
Bjoern Schiessle 3d0805f27d always use a \OC\Files\View 2014-06-25 12:27:30 +02:00
Bjoern Schiessle 709691548d always use oc filesystem for rename operation 2014-06-25 12:27:30 +02:00
Bjoern Schiessle 9c45a3196b add unit tests 2014-06-24 10:43:07 +02:00
Bjoern Schiessle 6b85fe819c always use '/' as directory seperator 2014-06-24 09:29:11 +02:00
Bjoern Schiessle e20bb71a42 remove unused code 2014-06-18 13:26:42 +02:00
Robin Appelman 790d51ea1e Fix checking for external share in encryption 2014-06-14 10:14:07 +02:00
Bjoern Schiessle 277f25222a if file doesn't exist, check parent folder 2014-06-14 10:14:07 +02:00
Bjoern Schiessle c580aeb455 exclude mounted server-to-server shares from encryption 2014-06-14 10:14:07 +02:00
Bjoern Schiessle 961317d911 make sure to enable incognito mode when mounting a public link and update init status of the encryption app 2014-06-14 10:14:07 +02:00
Bjoern Schiessle 329bfd81c3 remove encryption keys if user unshares a file 2014-06-06 09:55:59 +02:00
Thomas Müller e9011a8c55 adding unit tests for encryption data migration 2014-06-05 16:54:04 +02:00
Bjoern Schiessle eb29b2984c use oc_preferences instead of oc_encryption to store encyption settings 2014-06-05 16:54:04 +02:00
Bjoern Schiessle 3a698bce6e don't ask for fileInfo if we already have one 2014-06-04 07:55:45 +02:00
Thomas Müller d3e830e938 Merge pull request #8729 from owncloud/add-phpseclib-master
use phpseclib from 3rdparty
2014-06-03 12:19:04 +02:00
Thomas Müller 17cbfc714a use phpseclib from 3rdparty
rename class Crypt_Blowfish to Legacy_Crypt_Blowfish
2014-06-03 12:18:30 +02:00
Morris Jobke 390d8e53b4 Merge pull request #8676 from owncloud/encryption_improvements
cleanup encryption code, improved return codes
2014-06-02 18:28:18 +02:00
Bjoern Schiessle b16b17f920 ceanup encryption code, improved return codes 2014-06-02 13:15:11 +02:00
Bjoern Schiessle 9ed5083efd get mount point from mount manager 2014-05-28 17:28:31 +02:00
Morris Jobke dc36d30953 Remove all occurences of @brief and @returns from PHPDoc
* test case added to avoid adding them later
2014-05-19 17:50:53 +02:00
Robin McCorkell e7aebc5c32 Fix whitespace issues 2014-05-16 22:23:36 +01:00
Robin McCorkell 6930ae22e4 Fix more missing or broken PHPDoc 2014-05-16 22:21:57 +01:00
Robin McCorkell c4f1de63a8 Fix PHPDoc in /apps 2014-05-16 22:21:57 +01:00
Thomas Müller 58857b8df5 @returns -> @return 2014-05-13 19:09:15 +01:00
Björn Schießle b8de1e5d71 Merge pull request #8398 from owncloud/enc_backup_keys
backup the encryption key after the encryption was disabled
2014-05-13 09:25:16 -04:00
Bjoern Schiessle a9ac11718e backup the encryption key after the encryption was disabled so that the user
can restore them if needed
2014-05-13 12:35:25 +02:00
Thomas Müller e0dd69e4e6 remove legacy aka deprecated code: OC_FilesystemView 2014-05-12 16:30:39 +02:00
Thomas Müller 4dd1a49a68 remove legacy aka deprecated code: OC_Filesystem 2014-05-12 16:20:07 +02:00
Bjoern Schiessle 57b671ebec only update the values which really changed 2014-04-30 12:48:16 +02:00
Bjoern Schiessle 73a2d87ab4 fix shouldEncrypt() method and improved decryptAll() unit tests 2014-04-28 14:49:19 +02:00
Bjoern Schiessle fb88aba8f4 some fixes to make the gallery work, this made it necessary to adjust some tests and the encryption code 2014-04-23 12:54:26 +02:00
Bjoern Schiessle a86d97295e fix encryption tests after the removal of the shared folder 2014-04-23 12:54:25 +02:00
Lukas Reschke e704bc2bf0 Merge pull request #7807 from sarciszewski/patch-1
Update crypt.php
2014-04-11 19:19:02 +02:00
Vincent Petry a6de5efbab Merge pull request #7978 from owncloud/enc_cleanup
there is no need to re-calculate the shares after a touch
2014-04-02 18:23:33 +02:00
Morris Jobke 1782dcbb50 Merge pull request #7977 from owncloud/fix_enc_if_sharing_is_disabled
always encrypt files to owner
2014-04-02 13:20:51 +02:00
Björn Schießle c45793033d Merge pull request #7912 from owncloud/enc_move_checks_to_pre_hook
move check if a file should be encrypted to the pre hook
2014-04-01 13:56:46 +02:00
Bjoern Schiessle c578ab68fe there is no need to re-calculate the shares after a touch 2014-03-31 18:24:53 +02:00
Bjoern Schiessle 8e34812393 always encrypt files to owner 2014-03-31 18:19:48 +02:00
Bjoern Schiessle aa867ad647 don't call getFileInfo() to avoid to open the same file twice 2014-03-31 15:29:16 +02:00
Bjoern Schiessle 8ebb1f15d3 move check if a file should be encrypted to the pre hook 2014-03-31 15:29:16 +02:00
Bjoern Schiessle b9100bc2de don't write file if opening a stream to encrypt the data fails 2014-03-28 12:02:49 +01:00
Scott Arciszewski 09cc020535 Update crypt.php
Use a 256-bit random value
2014-03-24 08:57:33 -04:00
Vincent Petry 37af74efb3 Merge pull request #7655 from owncloud/shared-unencryptedsize
Fixed warning when browsing Shared folder
2014-03-21 12:28:27 +01:00
Scott Arciszewski 36da3bc359 Update crypt.php
A 1024 kilobyte key would be obnoxiously slow to operate on. I'm assuming you meant 1024-bit?

Also, 183 bytes = 1464 bits.

Here's a safe alternative: 2048 bits, with comment-code sanity
2014-03-19 13:31:51 -04:00
Thomas Müller bbbbb033f3 in case of phpunit executions calling header() and exit() is too bad 2014-03-14 18:20:33 +01:00
Vincent Petry 022d76c7bb Fixed warning when browsing Shared folder
The virtual "Shared" folder doesn't have an unencrypted_size field.
This fix adds a check to prevent warnings in the log.
2014-03-10 17:25:16 +01:00
Vincent Petry 48d63a6278 Return unencrypted_size of folder when queried
This fixes the "used space" to be based on the unencrypted size, not
encrypted size, to be consistent with how quota/space is handled when
encryption is enabled
2014-03-07 14:59:09 +01:00
Bjoern Schiessle fbd8c00a89 don't create files folder, let ownCloud core handle it 2014-03-05 12:44:02 +01:00
Björn Schießle 61bc76fdd6 Merge pull request #7454 from owncloud/enc_remember_fopen_mode
[enc] remember original fopen access type in pre-proxy
2014-02-28 09:57:58 +01:00
Vincent Petry fefd724858 Fixed wrong field name
This re-fixes an issue where the unencrypted size isn't updated
correctly when saving a text file in the UI multiple times.

Fixes #7467
2014-02-27 23:53:29 +01:00
Bjoern Schiessle 4ace1a273d remember original fopen access type in pre-proxy because sometimes they change
during the fopen call, e.g. 'r' becomes 'r+' if we open an URL
2014-02-27 14:16:03 +01:00
Bjoern Schiessle 86b3cdc132 close encryption session after decryption was finished 2014-02-26 17:18:38 +01:00
Scrutinizer Auto-Fixer adaee6a5a1 Scrutinizer Auto-Fixes
This patch was automatically generated as part of the following inspection:
https://scrutinizer-ci.com/g/owncloud/core/inspections/cdfecc4e-a37e-4233-8025-f0d7252a8720

Enabled analysis tools:
 - PHP Analyzer
 - JSHint
 - PHP Copy/Paste Detector
 - PHP PDepend
2014-02-19 09:31:54 +01:00
Thomas Müller c6f4f85e27 Merge branch 'master' into scrutinizer_documentation_patches
Conflicts:
	lib/private/migration/content.php
2014-02-18 18:31:33 +01:00
Thomas Müller 1e84d6b14b Merge pull request #7190 from owncloud/appconfig-legacy-apps
Remove usage of legacy OC_Appconfig
2014-02-18 18:10:22 +01:00
Lukas Reschke 3b1083f46e Merge pull request #7176 from owncloud/style
Some style fixes
2014-02-18 17:30:26 +01:00
Bjoern Schiessle f2f5769df7 catch errors during decryption 2014-02-17 10:03:57 +01:00
Bjoern Schiessle 2ab062193a catch errors during initial encryption 2014-02-17 09:58:46 +01:00
Thomas Müller 9fac95c2ab Merge branch 'master' into scrutinizer_documentation_patches
Conflicts:
	lib/private/appconfig.php
2014-02-14 23:03:27 +01:00
icewind1991 2a7509ee50 Merge pull request #6748 from owncloud/fileinfo
Add a FileInfo class which holds all info of a file ...
2014-02-14 15:16:39 +01:00
Robin Appelman 181bbd4325 Remove usage of legacy OC_Appconfig 2014-02-13 16:28:49 +01:00
Bart Visscher 1fb5f96c37 Style fixes 2014-02-12 09:09:51 +01:00
Joas Schilling b330d07b51 Fix more documentation failes
Issue #7111
2014-02-08 11:47:55 +01:00
Jörn Friedrich Dreyer 2a6a9a8cef polish documentation based on scrutinizer patches 2014-02-06 17:02:21 +01:00
Bjoern Schiessle 97921d0c25 add function to extract filename from sharekey name + tests 2014-02-03 13:39:05 +01:00
Bjoern Schiessle bef58f5361 don't expect OC_FilesystemView, this is depreciated 2014-01-31 20:39:52 +01:00
Bjoern Schiessle 4d1086c35f better error detection and don't use glob() 2014-01-31 20:39:11 +01:00
Bjoern Schiessle 5610842e56 move unlink proxy to a hook which handles pre and post conditions 2014-01-31 20:38:35 +01:00
Robin Appelman 4e2b52a376 merge master into fileinfo 2014-01-29 16:33:27 +01:00
Bjoern Schiessle 83878b9a7d only update file cache with the unenecrypted size when the file was written 2014-01-24 16:01:00 +01:00