Commit graph

85 commits

Author SHA1 Message Date
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
e1027c3b87 Implement EncFSUtil.copyWholeStream()
Noticed we're doing full InputStream->OutputStream copies quite a bit
around the code, so this commit adds a utility function for that and
calls it from everywhere.
2012-02-29 23:59:49 -08:00
Mark Pariente
5f4c44ed7c Add test for zero-block passthrough 2012-02-29 21:47: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
7461211c01 Add support for per-block MAC headers
This commit implements the blockMACBytes and blockMACRandBytes options
that cause a header to be inserted in front of every file block
containing a MAC of the block (and optionally some random data).

Added support to EncFSConfig, EncFSConfigParser and EncFSConfigWriter
to recognize these options. Implemented the MAC computation,
verification and insertion in EncFSInputStream and EncFSOutputStream.
Added a new test volume configured with 8 bytes of MAC and 8 bytes of
random bytes as 'testvol-blockmac', and extended EncFSVolumeTest to
include a long file test that verifies the MAC computations.
2012-02-20 12:08:18 -08:00
Mark Pariente
41cae65321 Add long file tests that verify decrypted content
Added two 6000 byte files to the default and no unique IV test volumes
and added tests that verify decrypted content. These tests are useful
for testing block encryption.
2012-02-19 15:47:42 -08:00
Mark Pariente
4bb80ed120 Convert getDefaultConfig() to EncFSConfig() constructor 2012-02-19 12:40:42 -08: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
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
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
1097cdc980 Add test for the String constructor of EncFSVolume 2012-01-22 13:02:16 -08:00
aefo
23e44e1489 Method renames & adding license headers 2012-01-11 21:19:10 +00:00
aefo
86e4ead7fc Refactor to allow non local file system based volumes 2012-01-08 16:25:23 +00:00
aefo
e7c9798c57 Multiple updates
1) Bug fix for EncFSInputStream missing off the last byte of the stream
2) Initial support for EncFSFileOutputStream
3) Additional tests
4) EncFSComparer enhanced to check file read/ re-write
2012-01-01 16:11:28 +00:00
aefo
4d1754de1b Added check that the file names can be re-encoded correctly 2011-12-30 15:27:10 +00:00
aefo
4bb7895043 inital commit of being able to encode file names 2011-12-26 18:43:44 +00:00
aefo
bdee7ef4fa Merge remote-tracking branch 'upstream/master'. Also extracted unit
tests to new files

Conflicts:
	src/main/java/org/mrpdaemon/sec/encfs/EncFSCrypto.java
	src/main/java/org/mrpdaemon/sec/encfs/EncFSFile.java
	src/test/java/org/mrpdaemon/sec/encfs/EncFSComparer.java
	src/test/java/org/mrpdaemon/sec/encfs/EncFSVolumeTest.java
2011-12-21 18:05:11 +00:00
aefo
31a551c0db Initial commit for support of encoding file names (still work in
progress)
2011-12-21 11:24:00 +00:00
Mark Pariente
bf71a24594 Add more test volumes
Added test volumes created with encfs 1.7.4:

* Default settings
* No uniqueIV (no per-file IV header)
2011-12-21 00:13:12 -08:00
Mark Pariente
6986e111c7 Don't use BufferedInputStream in EncFSVolumeTest 2011-12-20 23:28:35 -08:00
aefo
8db0057abc Correct compile error 2011-12-20 23:20:11 -08:00
aefo
ccceecb4b5 added comment 2011-12-20 23:20:11 -08:00
aefo
5040a34afd Test too to verify / compare directory & file info between encfs-java
decode & mounted encf volume
2011-12-20 23:20:11 -08:00
aefo
b4b0d573db Created tests for EncFSUtil 2011-12-20 23:20:11 -08:00
aefo
89d2f4992a Added test using incorrect password against an encfs volume 2011-12-20 23:20:11 -08:00
aefo
18655cb8de Addition of unit tests for the encfs samples 2011-12-20 23:20:11 -08:00
aefo
e389ca2ee0 Added file size checking 2011-12-18 18:29:43 +00:00
aefo
a66aafa759 Correct compile error 2011-12-18 17:35:10 +00:00
aefo
a363b36437 added comment 2011-12-18 17:24:00 +00:00
aefo
612bee5e6b Test too to verify / compare directory & file info between encfs-java
decode & mounted encf volume
2011-12-18 17:22:05 +00:00
aefo
bd5a5f1ed8 Created tests for EncFSUtil 2011-12-17 21:31:21 +00:00
aefo
b626f36f94 Added test using incorrect password against an encfs volume 2011-12-17 20:59:37 +00:00
aefo
f9b021b9f0 Addition of unit tests for the encfs samples 2011-12-17 20:46:56 +00:00