Commit graph

62 commits

Author SHA1 Message Date
Mark Pariente
cc1a1b6316 Rename derivedPassword -> derivedKeyData 2013-03-09 20:15:00 -08:00
Mark Pariente
dc1303866e Comment fixes and renaming in EncFSVolume 2013-02-24 18:21:19 -08:00
Mark Pariente
6f862ab1ac Make EncFSVolume.countFiles() public again 2013-02-24 17:22:39 -08:00
Mark Pariente
4e0c38a2a6 Rename {Block|Stream}Cryptography -> {Block|Stream}Crypto 2013-02-22 21:51:28 -08:00
Mark Pariente
8f0698b0d6 Don't require org.slf4j.Logger in the library 2013-02-22 21:37:28 -08:00
Mark Pariente
06ea3755dd Fix complier warnings 2013-02-22 21:18:19 -08:00
Mark Pariente
716555ab51 Fix formatting 2013-02-22 21:04:17 -08:00
Lars Gohlke
43a8b748cf more cleanups 2013-02-18 00:21:43 +01:00
Lars Gohlke
8a5acc39bc moved volume key things out of EncFSCrypto 2013-02-17 23:32:05 +01:00
Lars Gohlke
ab800962fb moved block-operations out of EncFSCrypto 2013-02-17 22:44:10 +01:00
Lars Gohlke
cdf8275e69 move Volume creation into the Builder 2013-02-17 21:06:52 +01:00
Lars Gohlke
c50d0500b2 cleanup 2013-02-17 19:48:15 +01:00
Lars Gohlke
8614e3f4ec added fail test for EncFSAlgorithm 2013-02-17 19:21:20 +01:00
Lars Gohlke
010631b166 created Builder for EncFSVolume 2013-02-17 19:09:47 +01:00
Lars Gohlke
48d520e4c1 removed duplication 2013-02-17 17:24:46 +01:00
Lars Gohlke
24eb9121e2 reformatted all 2013-02-17 17:18:14 +01:00
Lars Gohlke
82150ae423 removed @throws javadocs 2013-02-17 17:16:20 +01:00
Lars Gohlke
a8566ff42b cleanup EncFSFileProvider.java 2013-02-17 16:06:36 +01:00
Lars Gohlke
c72cc51d02 cleaned up EncFSConfig.java 2013-02-17 15:32:03 +01:00
Lars Gohlke
0ccb480b13 Revert "reformatted code"
This reverts commit 23c1e5d78c.
2013-02-17 13:57:37 +01:00
Lars Gohlke
23c1e5d78c reformatted code 2013-02-17 13:39:27 +01:00
Mark Pariente
f02bca7e9e Custom PBKDF2 provider implementation 2012-11-19 01:10:52 -08:00
Mark Pariente
9077078751 Add copy/move support using externalIvChaining 2012-10-14 17:17:35 -07:00
Mark Pariente
ffeb63e733 Fix return types for input/output stream functions 2012-08-26 00:32:44 -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
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
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
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
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
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
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
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
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
216a33901a Throw exception from EncFSLocalFileProvider.mkdir()
Made EncFSLocalFileProvider.mkdir() throw a FileNotFoundException
if one or more path elements aren't found. Also modified
EncFSVolume.makeDir to filter this exception to print the
unencrypted path in the exception message.
2012-03-03 17:33:30 -08:00
Mark Pariente
f5daf6d52a Code style, formatting and API name cleanups
This is a massive commit serving a few purposes:

 * Unify code formatting and style to conform to Eclipse formatting. We
   will use this formatting from now on for all new code to have a
   uniform codebase.

 * Clean up API naming and remove redundancies. I've renamed a lot of
   API functions to promote coherence across the codebase. I've also
   removed some redundant API's to promote best practices.

 * Improve JavaDoc coverage. This commit documents all public methods
   within the library itself.

 * Fix JavaDoc warnings.
2012-02-27 23:03:14 -08:00
Mark Pariente
3e825f410a Merge remote-tracking branch 'aefo/master' into master
Conflicts:
	src/main/java/org/mrpdaemon/sec/encfs/EncFSConfigWriter.java
	src/main/java/org/mrpdaemon/sec/encfs/EncFSVolume.java
	src/test/java/org/mrpdaemon/sec/encfs/EncFSVolumeTest.java
2012-02-22 21:08:52 -08:00
aefo
9625039638 Added further tests for EncFSVolume 2012-02-22 19:28:42 +00:00
Mark Pariente
e47c694c0e createVolume() no longer instantiates EncFSVolume
Separated the step of instantiating an EncFSVolume from the
createVolume() function. This allows batch volume creation support
without having to do the associated crypto that comes with creating
an EncFSVolume object to actually use the created volume.
2012-02-19 12:13:22 -08:00
Mark Pariente
87eea27c1d Use SecureRandom instead of Random 2012-02-12 19:04:50 -08:00
Mark Pariente
b4d230dac7 Volume creation support
This commit adds initial support for volume creation. A new class was
added for writing an EncFSConfig to a file (EncFSConfigWriter). Provided
utility methods for getting a default EncFSConfig and creating a new
volume with a given password and EncFSConfig.

Added a basic volume creation test which creates a temporary directory
and creates a volume within, making sure that encfs-java is able to
instantiate an EncFSVolume on it afterwards. I also made sure that the
upstream encfs implementation can read the volume created by this test
also.
2012-02-11 19:52:25 -08:00
Mark Pariente
f1cb71fc4e Get rid of deprecated EncFSFile constructor
We shouldn't use the EncFSFile constructor that takes in a File any
more since we have EncFSLocalFileProvider now. This change removes
that constructor and all the EncFSVolume special casing for it.
2012-02-10 00:15:16 -08:00
Mark Pariente
e69353840d EncFSVolume constructor refactoring
Removed all File based constructors for EncFSVolume. Only kept the
following constructors:

EncFSVolume(String rootPath, String password)
EncFSVolume(String rootPath, byte[] passwordKey)
EncFSVolume(EncFSFileProvider fileProvider, String password)
EncFSVolume(EncFSFileProvider fileProvider, byte[] passwordKey)
EncFSVolume(EncFSFileProvider fileProvider, EncFSConfig config,
            String password)
EncFSVolume(EncFSFileProvider fileProvider, EncFSConfig config,
            byte[] passwordKey)

The first two constructors are easy to use ones for volumes on the local
filesystem. The next two allow non-local storage to be plugged in using
a custom EncFSFileProvider implementation. The last two allow the config
file to be parsed externally, to support the use case where the config
file is located separately than the volume.
2012-02-01 18:59:49 -08:00
Mark Pariente
f1f22e113a Rename file provider classes
EncFSNativeFileSource -> EncFSFileProvider
EncFSLocalFileSystemNativeFileSource -> EncFSLocalFileProvider
2012-02-01 18:13:53 -08:00