Add volume integration test for externalIvChaining
This commit is contained in:
parent
ac206ef549
commit
1400864304
5 changed files with 105 additions and 2 deletions
src/test/java/org/mrpdaemon/sec/encfs
test/encfs_samples
|
@ -225,6 +225,56 @@ public class EncFSVolumeIntegrationTest {
|
|||
assertLengthCalculations(rootDir);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtIvChain() throws EncFSInvalidPasswordException,
|
||||
EncFSInvalidConfigException, EncFSCorruptDataException,
|
||||
EncFSUnsupportedException, EncFSChecksumException, IOException {
|
||||
File encFSDir = new File("test/encfs_samples/testvol-extivchn");
|
||||
Assert.assertTrue(encFSDir.exists());
|
||||
|
||||
String password = "test";
|
||||
EncFSVolume volume = new EncFSVolume(encFSDir.getAbsolutePath(),
|
||||
password);
|
||||
EncFSFile rootDir = volume.getRootDir();
|
||||
EncFSFile[] files = rootDir.listFiles();
|
||||
Assert.assertEquals(2, files.length);
|
||||
|
||||
String contents;
|
||||
int numOuterMatches = 0, numInnerMatches = 0;
|
||||
|
||||
for (EncFSFile encFSFile : files) {
|
||||
if (encFSFile.getName().equals("test.txt")) {
|
||||
numOuterMatches++;
|
||||
Assert.assertFalse(encFSFile.isDirectory());
|
||||
contents = readInputStreamAsString(encFSFile);
|
||||
Assert.assertEquals(
|
||||
"this is a test file with external IV chaining",
|
||||
contents);
|
||||
} else if (encFSFile.getName().equals("directory")) {
|
||||
numOuterMatches++;
|
||||
Assert.assertTrue(encFSFile.isDirectory());
|
||||
|
||||
// Traverse down the directory
|
||||
for (EncFSFile subFile : encFSFile.listFiles()) {
|
||||
numInnerMatches++;
|
||||
Assert.assertEquals(subFile.getName(),
|
||||
"another-test-file.txt");
|
||||
contents = readInputStreamAsString(subFile);
|
||||
Assert.assertEquals(
|
||||
"this is another test file with external IV chaining",
|
||||
contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertEquals(numOuterMatches, 2);
|
||||
Assert.assertEquals(numInnerMatches, 1);
|
||||
|
||||
assertFileNameEncoding(rootDir);
|
||||
assertEncFSFileRoundTrip(rootDir);
|
||||
assertLengthCalculations(rootDir);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBoxCryptor_1() throws EncFSInvalidPasswordException,
|
||||
EncFSInvalidConfigException, EncFSCorruptDataException,
|
||||
|
|
File diff suppressed because one or more lines are too long
37
test/encfs_samples/testvol-extivchn/.encfs6.xml
Normal file
37
test/encfs_samples/testvol-extivchn/.encfs6.xml
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<!DOCTYPE boost_serialization>
|
||||
<boost_serialization signature="serialization::archive" version="9">
|
||||
<cfg class_id="0" tracking_level="0" version="20">
|
||||
<version>20100713</version>
|
||||
<creator>EncFS 1.7.4</creator>
|
||||
<cipherAlg class_id="1" tracking_level="0" version="0">
|
||||
<name>ssl/aes</name>
|
||||
<major>3</major>
|
||||
<minor>0</minor>
|
||||
</cipherAlg>
|
||||
<nameAlg>
|
||||
<name>nameio/block</name>
|
||||
<major>3</major>
|
||||
<minor>0</minor>
|
||||
</nameAlg>
|
||||
<keySize>256</keySize>
|
||||
<blockSize>1024</blockSize>
|
||||
<uniqueIV>1</uniqueIV>
|
||||
<chainedNameIV>1</chainedNameIV>
|
||||
<externalIVChaining>1</externalIVChaining>
|
||||
<blockMACBytes>8</blockMACBytes>
|
||||
<blockMACRandBytes>0</blockMACRandBytes>
|
||||
<allowHoles>1</allowHoles>
|
||||
<encodedKeySize>52</encodedKeySize>
|
||||
<encodedKeyData>
|
||||
LT6tG7SRgYpVD3bmMAtDs7PAae9NSavH0kBlkMZ/lwBdPw+wrF3LfkbL+eWo4huu00rouA==
|
||||
</encodedKeyData>
|
||||
<saltLen>20</saltLen>
|
||||
<saltData>
|
||||
/7neEwCar1Ipa6AWv566tsDdWT4=
|
||||
</saltData>
|
||||
<kdfIterations>1161684</kdfIterations>
|
||||
<desiredKDFDuration>3000</desiredKDFDuration>
|
||||
</cfg>
|
||||
</boost_serialization>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ODþq¢…œÍà-,‡²{9=Di©OÒ꫞QÇ\tš£½B5ÿy^Sº¶G6¡L~{
|
||||
⺋.Îñy™³†,ú/
|
|
@ -0,0 +1 @@
|
|||
BZת5«<18>ה®ֵ‹ iֶP¡C<C2A1>„.<2E><>ף2¬<32>רָ\.`כ“@¹©‘‹ף‘‹[ָװ׀%מ€<D79E>1#װ¨.‘
|
Loading…
Add table
Add a link
Reference in a new issue