Commit Graph

231 Commits (master)

Author SHA1 Message Date
Mark Pariente c645cc1897 Create EncFSException and subclass exceptions to it 2012-08-22 23:23:02 -07:00
Mark Pariente e217bc0a8d Add missing volume descriptions 2012-08-22 23:18:31 -07:00
Mark Pariente 808eb37c91 Fail to create volume if externalIVChaining=1 2012-08-22 23:13:27 -07:00
Mark Pariente 83cf5d0d2d Fix CRLF usage
Unfortunate to have to do this, but with the new version of git diff
explicitly showing CRLF as ^M this was starting to get annoying. We
shall use Unix newline style in encfs-java going forward.
2012-08-22 23:08:00 -07:00
Mark Pariente cdcd5923e8 Implement unencrypted filename support (nameio/null)
BoxCryptor uses an unencrypted name algorithm to encrypt file contents
without encrypting filenames. This change implements this algorithm
and adds a unit test. Thanks 1jr for requesting this and providing
test cases.

Also added a volume integration test for this algorithm.
2012-08-14 00:46:32 -07:00
Mark Pariente dc7d4836f3 Don't treat uniqueIV differently in EncFSFile.copy
uniqueIV just generates a bunch of random bytes in the file header so
we can use fileProvider.copy() which is more efficient for most file
providers rather than doing a full stream read/write copy.
2012-08-03 02:01:10 -07:00
Mark Pariente cd75f18bb4 EncFSVolumeIntegrationTest shouldn't depend on file ordering 2012-07-22 19:06:07 -07:00
Mark Pariente e8bf978fb4 Switch file ordering for volume integration test 2012-07-14 15:52:21 -07:00
Mark Pariente f12672ebc3 Fix maven compilation with icedtea
Compiling with icedtea was failing due to annotations not being
supported with source version 1.3, which seems to be the default
with maven.
2012-07-14 15:50:08 -07:00
Mark Pariente 3214ebc711 Eclipse formatting (whitespace fixes) 2012-06-25 22:28:17 -07:00
Zdenek Farana 4e84fe6ad8 Polymorphic isEncFSVolume methods for File and EncFSFileProvider 2012-06-25 23:52:39 +02:00
Zdenek Farana ce6b9c4417 Simple method for checking if the provided path contains EncFS volume by detecting EncFS config file 2012-06-25 23:34:06 +02:00
Mark Pariente 4a08de9e25 Fix test failures in EncFSVolumeIntegrationTest 2012-06-13 02:16:30 -07:00
Mark Pariente 03c1814aa9 Handle partial reads in EncFSInputStream.readBlock()
With network based file providers it is possible for the input stream's
read() function to return before reading a full block. The current code
treated such partial reads incorrectly by using stream decoding to
decode them. Fix is to keep reading until we either read a full block
or we hit the end of the input stream.
2012-06-01 01:23:53 -07:00
Mark Pariente 84b8726b8c Fix whitespace formatting 2012-05-29 19:56:39 -07:00
michael1 869038b179 EncFSShell now supports files / path with spaces, if they are quoted.
Example: cat "this is a test file with quotoes"
2012-05-29 22:15:19 +03:00
Mark Pariente d1dcd79036 Add a test for file length calculations
Testing for EncFSVolume.getEncryptedFileLength() and
EncFSVolume.getDecryptedFileLength()
2012-05-24 20:21:40 -07:00
Mark Pariente 7a370eb704 Make EncFSFileOutputStream take a length parameter
Unfortunately some network storage systems such as Dropbox require
length of the file before opening an upload request so we need to
plumb file length all throughout the OutputStream creation. It is
optional for EncFSLocalFileProvider, but it is good practice to
supply this parameter whenever possible.
2012-05-24 20:21:31 -07:00
Mark Pariente 412d62e2e9 Remove stale code from EncFSLocalFileProvider
This code was causing double leading slashes in front of directories
and did not have any noticable benefits, tests pass without it.
2012-05-21 02:12:02 -07:00
Mark Pariente 80ffa6a78e Add EncFSProgressListener to monitor operation progress
copyPath() movePath() and deletePath() now take an optional
EncFSProgressListener in order to post progress events. This is useful
for displaying progress of long running operations.
2012-05-19 04:11:38 -07:00
Mark Pariente b494e51c1f Update readme with current capabilities 2012-04-29 02:27:44 -07:00
Mark Pariente f0aaefd377 Update readme with current capabilities 2012-04-29 02:26:27 -07:00
Mark Pariente 18cdf3b477 Fix stream name decoding with chained name IV
Stream name decoding with chained name IV was broken because chained
name IV computation was unconditionally padding each path element
whereas that should only be done for block name I/O algorithm. Fix
uses each path element as is for chained IV computation with stream
name algorithm.

Also added an integration test case containing a volume created with
encfs 1.7.4 that uses stream name algorithm and chained name IV
with a directory and a test file in that directory to exercise the
path that fails without this commit.
2012-04-29 01:49:34 -07:00
Mark Pariente afea85bf68 Implement EncFSFileProvider.getRootPath() 2012-04-28 01:49:21 -07:00
Mark Pariente c50de9fdd3 Implement separator interface for EncFSFileProvider 2012-04-28 01:39:33 -07:00
Mark Pariente 6849feb613 Use constants instead of "/" for volume paths 2012-04-27 23:37:46 -07:00
Mark Pariente 59b860cf92 Rename EncFSVolume constants to shorter versions 2012-04-27 23:31:21 -07:00
Mark Pariente 9a6cfa4ec4 Use combinePath() and ENCFS_VOLUME_PATH_SEPARATOR 2012-04-27 23:24:24 -07:00
Mark Pariente e21c9b8538 Add EncFSFile.combinePath() methods to combine paths 2012-04-27 22:41:51 -07:00
Mark Pariente 8c56794273 copyPath() and movePath() prevents overwriting existing files 2012-04-26 00:20:51 -07:00
Mark Pariente f9308bff4b EncFSVolume.copyOrMovePath() fails for srcPath == dstPath 2012-04-25 23:47:15 -07:00
Mark Pariente 3b5510aab8 Fix '/' path handling in EncFSShell.getPath() 2012-04-25 23:42:09 -07:00
Mark Pariente afa7b1e884 EncFSShell allows moving files/dirs into an existing dir 2012-04-25 23:42:09 -07:00
Mark Pariente f9a97aafe5 EncFSVolume.movePath() allows moving into existing dirs
Previous implementation didn't work if dstPath was an existing
directory, fix the implementation to move srcPath under dstPath
if dstPath exists and is a directory.
2012-04-25 23:42:09 -07:00
Mark Pariente 5fa007932e Avoid duplicate leading "//" in EncFSShell copy 2012-04-25 23:42:09 -07:00
Mark Pariente 3ea8d871a7 Add a test case for recursive directory copying 2012-04-25 23:42:09 -07:00
Mark Pariente 9d38e6188f EncFSVolume.copyOrMovePath() fix for dir copies
When copying a directory recursively we should manually
perform the recursion since EncFSFileProvider.copy()
interface doesn't allow recursive copies.

Also, we should update dstPath with the newly created
directory to copy/move stuff from srcPath into it.
2012-04-25 23:41:58 -07:00
Mark Pariente 117d181cf4 EncFSVolumeTest improvements
Create many different types of volumes and run the file operations
test on each volume. The following volume configurations are now
being tested:

* Default volume
* No Unique IV
* No Chained name IV
* No Unique IV or Chained IV
* No zero block passthrough
* 256-bit volume key
* 128-bit volume key
* 4096 byte block size
* Stream name algorithm
* 8 byte block MAC header
* 8 byte block MAC header + 8 random bytes

Also, I've split off the core testing logic into EncFSVolumeTestCommon,
and created two separate tests, one using CommonVFSFileProvider and one
using EncFSLocalFileProvider.

Misc cleanups:

* Split off createTempDir() to be under EncFSVolumeTestCommon
* Sort file lists in testFileOperations to deal with arbitrary ordering
  from EncFSFileProvider's
2012-03-07 23:31:32 -08:00
Mark Pariente ab016fef4c Fix CommonVFSFileProvider.copy()
For some reason FileObject.copyFrom() was failing to copy files, so
instead use FileUtil.copyContents().
2012-03-07 23:31:32 -08:00
Mark Pariente dba45202f8 Don't produce // as parentPath in EncFSLocalFileProvider 2012-03-07 23:31:32 -08:00
Mark Pariente ff3a20305f Turn on allowHoles in the default EncFSConfig 2012-03-07 01:15:11 -08:00
Mark Pariente f12f98a2a1 Make EncFSVolume.recursiveDelete private 2012-03-07 00:47:17 -08:00
Mark Pariente 00636eaaa1 EncFSVolume.deletePath() can remove non-empty dirs
Implemented recursive directory deletion support controlled by a
boolean option in EncFSVolume.deletePath(). Extended the EncFSShell
'rm' command to make use of this functionality and added a test
case to EncFSVolumeTest to exercise recursive deletion of a
non-empty directory path.
2012-03-07 00:42:27 -08:00
Mark Pariente a6955a5dd5 Add missing zerofile.bin to Samples.txt 2012-03-06 23:34:16 -08:00
Mark Pariente 6e814aba75 Implement cp command for EncFSShell 2012-03-04 02:00:35 -08:00
Mark Pariente d38dd6015d Improve recursive copy support
Make EncFSVolume.copyPath() more robust by making it able to
recursively copy directories even with the ChainedNameIV config
option.
2012-03-04 01:59:52 -08:00
Mark Pariente e92b409abd Add missing continue in 'mv' error path 2012-03-04 00:06:38 -08:00
Mark Pariente f46201577d Fix style 2012-03-04 00:06:26 -08:00
Mark Pariente 87ca7a109f Fix EncFSVolume.movePath() for ChainedNameIV
There was a bug in EncFSVolume.movePath() that caused recursive moves
in the case of ChainedNameIV configurations to fail. Also improved
rollback handling in the case of an error during the recursive move
by trying to delete the newly created directories.

Added a FileNotFoundException to EncFSLocalFileProvider.move()
implementation as well.
2012-03-03 23:54:29 -08:00
Mark Pariente 8b49d66127 Absolute/relative path handling in EncFSShell
This commit cleans up EncFSShell path handling to allow absolute paths
as well as relative paths with multiple path elements. For example:

/ > ls
testdir1/
/ > ls testdir1/testdir2
testdir-with-really-really-long-name/
testfile2.txt
/ > cd testdir1/testdir3/testdir4
/testdir1/testdir3/testdir4 > cat /testdir1/testfile.txt
file contents!
file contents!
...

All existing commands were improved to use the new path handling
capabilities. Cleaned up error messages in the process as well.
2012-03-03 18:50:09 -08:00