]> source.dussan.org Git - nextcloud-server.git/commit
Fix encryption feof to not return too early
authorVincent Petry <pvince81@owncloud.com>
Mon, 20 Apr 2015 15:30:10 +0000 (17:30 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 20 Apr 2015 16:32:40 +0000 (18:32 +0200)
commit76dad297ffc4084d2057e2c2312f0c53f1e15f5b
treebc80e8b29b01c02cbe7b94dc671e16fec62eed61
parent3e8f6cdba95690a12de4f8d6b99c59f7a823fbb0
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.
lib/private/files/stream/encryption.php
tests/data/block-aligned-plus-one.txt [new file with mode: 0644]
tests/data/block-aligned.txt [new file with mode: 0644]
tests/lib/files/stream/encryption.php