Commit graph

50 commits

Author SHA1 Message Date
Morris Jobke
b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Morris Jobke
1469177a3a Merge pull request #16406 from owncloud/enc-strlenperffix
Small perf tweak in strlen loop
2015-07-01 08:54:33 +02:00
Morris Jobke
f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
jknockaert
a577e723b0 flush() comments + perf opt 2015-05-26 10:22:52 +02:00
jknockaert
bf6151e799 fix calculation of $count, $count is always 8129 so we need to check this
against the unencrypted file size
2015-05-21 14:15:26 +02:00
Bjoern Schiessle
5a20edac82 test to simulate a non-seekable stream wrapper 2015-05-21 14:15:26 +02:00
jknockaert
fb51880a4a encrypted filesize calculation in flush() 2015-05-21 14:15:26 +02:00
jknockaert
2834971a77 fix #16356 2015-05-18 15:06:55 +02:00
Vincent Petry
9d3d7ec659 Small perf tweak in strlen loop 2015-05-18 13:27:22 +02:00
jknockaert
f5415653fd fix #15973
Rework of stream_seek handling; there where basically two bugs: 1. seeking to the end of the current file would fail (with SEEK_SET); and 2. if seeking to an undefined position (outside 0,unencryptedSize) then newPosition was not defined. I used the opportunity to simplify the code.
2015-04-30 17:10:18 +02:00
Bjoern Schiessle
27683f9442 fall back to the ownCloud default encryption module and aes128 if we read a encrypted file without a header 2015-04-27 13:01:18 +02:00
Bjoern Schiessle
9a5783b284 fix unit tests 2015-04-24 16:47:27 +02:00
jknockaert
49df8ef525 Update encryption.php 2015-04-24 16:44:00 +02:00
jknockaert
238302ee7d fixed name 2015-04-24 16:44:00 +02:00
jknockaert
1756562501 Update encryption.php 2015-04-24 16:44:00 +02:00
jknockaert
735f6cc037 fix encryption header error
When moving back the pointer to position 0 (using stream_seek), the pointer on the encrypted stream will be moved to the position immediately after the header. Reading the header again (invoked by stream_read) will cause an error, writing the header again (invoked by stream_write) will corrupt the file. Reading/writing the header should therefore happen when opening the file rather than upon read or write. Note that a side-effect of this PR is that empty files will still get an encryption header; I think that is OK, but it is different from how it was originally implemented.
2015-04-24 16:43:16 +02:00
Björn Schießle
570718fb6b Merge pull request #15757 from owncloud/enc-fixfeofforlastblock
Fix encryption feof to not return too early
2015-04-22 11:32:21 +02:00
Bjoern Schiessle
19e8c4fcb1 get dirname from sharePath 2015-04-21 14:58:01 +02:00
Björn Schießle
b0fcf0fa0e Merge pull request #15636 from owncloud/enc2_performance_improvement
[encryption2] set size and unencrypted size to zero at the beginning of a write operation
2015-04-21 11:01:33 +02:00
Vincent Petry
76dad297ff Fix encryption feof to not return too early
This is because stream_read will pre-cache the next block which causes
feof($this->source) to return true prematurely. So we cannot rely on it.

Fixed encryption stream wrapper unit tests to actually simulate 6k/8k
blocks to make sure we cover the matching logic.

Added two data files with 8192 and 8193 bytes.
2015-04-20 18:32:40 +02:00
Bjoern Schiessle
7fe0e09d14 set size and unencrypted size to zero on fopen 2015-04-20 11:06:13 +02:00
Bjoern Schiessle
67500d5f2f if we start writing a file from the beginning, size should start by zero; result of floor needs to be casted to int in order to compare it with ->size 2015-04-16 14:15:04 +02:00
Thomas Müller
a4483243ac fixing license headers - encryption code related 2015-04-07 17:02:49 +02:00
Thomas Müller
69e95531f8 comment change as it broke unit tests 2015-04-07 13:30:31 +02:00
jknockaert
ff16e3dbff Adjusting count on read 2015-04-07 13:30:31 +02:00
jknockaert
02404a6a8c Fixing encryption stream wrapper seek - thanks @jknockaert 2015-04-07 13:30:30 +02:00
Thomas Müller
8ffa6db110 fixing unit tests for stream wrapper 2015-04-07 13:30:30 +02:00
Thomas Müller
cac83642f2 Finally fixing encryption with public share 2015-04-07 13:30:30 +02:00
Bjoern Schiessle
e4895bda01 add helper class accessible for encryption modules to ask for a list of users with access to a file, needed to apply the recovery key to all files 2015-04-07 13:30:29 +02:00
Bjoern Schiessle
0eee3a2618 remove unencrypted_size from the cache, size will contain the unencrypted size 2015-04-07 13:30:28 +02:00
Thomas Müller
d185761d31 initializing some variables + update size after writing the headers 2015-04-07 13:30:28 +02:00
Thomas Müller
4441835d18 https://github.com/owncloud/core/pull/15305#discussion_r27382305
Conflicts:
	lib/private/files/stream/encryption.php
2015-04-07 13:30:28 +02:00
Thomas Müller
90487384f7 initializing some variables 2015-04-07 13:30:28 +02:00
Bjoern Schiessle
0c48b069ba call end() before closing the file 2015-04-07 13:30:28 +02:00
Thomas Müller
498625ea3a adding unit tests for stream wrapper 2015-04-07 13:30:28 +02:00
jknockaert
3e6eb28ee3 Applying diff as of https://github.com/owncloud/core/pull/15303 2015-04-07 13:30:28 +02:00
Thomas Müller
232518ac54 Merge pull request #15234 from owncloud/encryption2_core
core part of encryption 2.0
2015-03-26 21:14:59 +01:00
Bjoern Schiessle
ff9c85ce60 implement basic encryption functionallity in core to enable multiple encryption modules 2015-03-26 20:56:51 +01:00
Jenkins for ownCloud
b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Morris Jobke
06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud
6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Jörn Friedrich Dreyer
f83689e1be in quota wrapper use === instead of ! for better readability and as in other wrappers 2014-09-22 11:35:42 +02:00
Jörn Friedrich Dreyer
561a7e47cd return boolean in Ciose::stream_seek 2014-09-22 11:33:55 +02:00
Jörn Friedrich Dreyer
b752cb98d8 return boolean in OC::stream_seek 2014-09-22 11:20:15 +02:00
Vincent Petry
3507964820 Fixed quota wrapper to return the value from flock() 2014-06-04 12:36:53 +02:00
Robin McCorkell
4755392c65 More PHPDoc for file functions 2014-05-13 19:09:14 +01:00
Jörn Friedrich Dreyer
2a6a9a8cef polish documentation based on scrutinizer patches 2014-02-06 17:02:21 +01:00
Vincent Petry
ebcd9ae628 Added comment for clarification about fseek() call in quota.php 2013-10-25 16:15:01 +02:00
Vincent Petry
d8b245490b Fixed quota stream's fseek method
- Added missing return statement
- Added missing support for SEEK_END
- Fixes #5524
2013-10-25 12:09:46 +02:00
Thomas Müller
9c9dc276b7 move the private namespace OC into lib/private - OCP will stay in lib/public
Conflicts:
	lib/private/vcategories.php
2013-09-30 16:36:59 +02:00