Commit graph

25 commits

Author SHA1 Message Date
Mark Pariente
489f3f607a EncFSInputStream.read() result should be positive
According to java.io.InputStream spec read() needs to normalize the
value of the returned byte to be between 0-255.

Fixes mrpdaemon/encfs-java#57
2014-11-27 02:15:52 -08:00
Mark Pariente
7eac39ff60 Comment, visibility and naming fixes 2013-02-24 22:56:13 -08:00
Mark Pariente
dc1303866e Comment fixes and renaming in EncFSVolume 2013-02-24 18:21:19 -08:00
Mark Pariente
4e0c38a2a6 Rename {Block|Stream}Cryptography -> {Block|Stream}Crypto 2013-02-22 21:51:28 -08:00
Mark Pariente
716555ab51 Fix formatting 2013-02-22 21:04:17 -08:00
Lars Gohlke
f42c0460f0 moved stream things out of EncFSCrypto 2013-02-17 23:37:13 +01:00
Lars Gohlke
ab800962fb moved block-operations out of EncFSCrypto 2013-02-17 22:44:10 +01:00
Lars Gohlke
010631b166 created Builder for EncFSVolume 2013-02-17 19:09:47 +01:00
Lars Gohlke
24eb9121e2 reformatted all 2013-02-17 17:18:14 +01:00
Lars Gohlke
6c5757f1f9 cleanup 2013-02-17 17:04:35 +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
Lars Gohlke
8ec6533bc2 cleanup of EncFSUtil 2013-02-17 13:21:09 +01: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
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
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
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
ba773dfdb9 Implement zero-block passthrough 2012-02-29 21:22:26 -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
2ed6748688 Get rid of the extra copies in input/output streams
The extra copy in EncFSInputStream wasn't necessary. Unfortunately the
copy in EncFSOutputStream can't be averted, but this commit moves it to
be in streamEncode() itself.
2012-02-20 22:52:24 -08:00
Mark Pariente
a85ddabccb Add a version of EncFSCrypto.mac64 without length 2012-02-20 22:17:06 -08: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
aefo
e26ae1462e Change throwing of caught exceptions to include the original / inner
one (to make it easier to trace issues / debug the original cause)
2012-01-31 20:03:24 +00:00
aefo
86e4ead7fc Refactor to allow non local file system based volumes 2012-01-08 16:25:23 +00:00