Commit graph

188 commits

Author SHA1 Message Date
Mark Pariente
50c4ca3b3f Fix bad input handling in EncFSBase64.decodeEncfs()
Since java treats the byte type as signed when used as an array index it
is possible for values >= 128 to cause ArrayIndexOutOfBoundsException.
Fix handling in EncFSBase64.decodeEncfs() to not crash with such bad
input.
2013-01-30 23:23:16 -08:00
Joscha Feth
2baa3380d1 fix c&p typo 2013-01-20 02:49:58 +01:00
Mark Pariente
09c7dcebc4 Fix crash in EncFSLocalFileProvider.listFiles()
Handle the case where the given path is not a directory by throwing an
IOException. Previously this would result in a NullPointerException.
2012-12-27 15:14:45 -05:00
Mark Pariente
f02bca7e9e Custom PBKDF2 provider implementation 2012-11-19 01:10:52 -08:00
Mark Pariente
3c91144609 Move test classes into their own namespace 2012-10-14 22:10:50 -07:00
Mark Pariente
1400864304 Add volume integration test for externalIvChaining 2012-10-14 17:17:35 -07:00
Mark Pariente
ac206ef549 Validate config dependencies for externalChainIv
UniqueIV and ChainedNameIV are required for externalChainIV.
2012-10-14 17:17:35 -07:00
Mark Pariente
9077078751 Add copy/move support using externalIvChaining 2012-10-14 17:17:35 -07:00
Mark Pariente
7ca1633809 Add support for externalIvChaining in EncFS{Input|Output}Stream
This commit implements support for externalIvChaining in
EncFSInputStream and EncFSOutputStream which causes a file's volume path
to change the initialization vector (IV) which is used for encrypting
and decrypting the file contents.
2012-10-14 16:59:32 -07:00
Mark Pariente
e007337167 Remove stale comment in EncFSConfigWriter 2012-10-08 23:36:06 -07:00
Mark Pariente
6616b322b7 Volume creation support in EncFSShell 2012-10-08 23:28:41 -07:00
Mark Pariente
b18c762bcb Recursively delete directories in EncFSLocalFileProvider
EncFSLocalFileProvider.delete() was only deleting a directory if it was
completely empty. It is more functional to just recursively delete
everything under a directory if its not empty.
2012-09-16 19:41:23 -07:00
Mark Pariente
6181b6ebdb Forgot to remove debugging logs 2012-08-26 03:22:54 -07:00
Mark Pariente
dd91907833 Implement versioning support 2012-08-26 03:13:25 -07:00
Mark Pariente
ffeb63e733 Fix return types for input/output stream functions 2012-08-26 00:32:44 -07:00
Mark Pariente
08dfe3d7ad Fix return types for EncFSFile.open{Input|Output}Stream
These methods were returning InputStream/OutputStream instead of the
more specific EncFSInputStream and EncFSOutputStream.
2012-08-26 00:08:54 -07:00
Mark Pariente
dbda446205 Fix warning and add attribution in EncFSBase64 2012-08-23 00:06:23 -07:00
Mark Pariente
b8a8f3dc6f Use Filter{Input|Output}Stream in stream classes
* EncFSFileInputStream now extends FilterInputStream
* EncFSFileOutputStream now extends FilterOutputStream
* EncFSInputStream now extends FilterInputStream

EncFSOutputStream was already using FilterOutputStream.
2012-08-22 23:53:19 -07:00
Mark Pariente
e80d4abac3 Catch EncFSException in EncFSShell 2012-08-22 23:31:41 -07:00
Mark Pariente
c645cc1897 Create EncFSException and subclass exceptions to it 2012-08-22 23:23:02 -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
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
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