diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-05-05 16:48:28 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-05-05 16:49:48 +0200 |
commit | 70cb053e6b03e2848cb54aea72c3f8e550ece69d (patch) | |
tree | d9a367b6caba0acd6df5e2cb38e05fae1a502f31 /apps/files_encryption/tests | |
parent | d875191777188bde61804452c55964842fceb083 (diff) | |
download | nextcloud-server-70cb053e6b03e2848cb54aea72c3f8e550ece69d.tar.gz nextcloud-server-70cb053e6b03e2848cb54aea72c3f8e550ece69d.zip |
improve cryptstream fro writing non-chunksized data
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-x | apps/files_encryption/tests/encryption.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php index 00466cc671c..cf24a225d28 100755 --- a/apps/files_encryption/tests/encryption.php +++ b/apps/files_encryption/tests/encryption.php @@ -38,5 +38,16 @@ class Test_Encryption extends UnitTestCase { OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key); $decrypted=file_get_contents($tmpFileDecrypted); $this->assertEqual($decrypted,$source); + + $file=OC::$SERVERROOT.'/core/img/weather-clear.png'; + $source=file_get_contents($file); //binary file + $encrypted=OC_Crypt::encrypt($source,$key); + $decrypted=OC_Crypt::decrypt($encrypted,$key); + $this->assertEqual($decrypted,$source); + + $encrypted=OC_Crypt::blockEncrypt($source,$key); + $decrypted=OC_Crypt::blockDecrypt($encrypted,$key); + $this->assertEqual($decrypted,$source); + } } |