From 4da245c69d7994efec75e1deaef56a03020d39db Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 1 Oct 2017 13:50:25 +0200 Subject: fusefrontend_reverse: fix 176-byte names A file with a name of exactly 176 bytes length caused this error: ls: cannot access ./tmp/dsg/sXSGJLTuZuW1FarwIkJs0w/b6mGjdxIRpaeanTo0rbh0A/QjMRrQZC_4WLhmHI1UOBcA/gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY: No such file or directory ls: cannot access ./tmp/dsg/sXSGJLTuZuW1FarwIkJs0w/b6mGjdxIRpaeanTo0rbh0A/QjMRrQZC_4WLhmHI1UOBcA/gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY.name: No such file or directory -????????? ? ? ? ? ? gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY -????????? ? ? ? ? ? gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY.name Root cause was a wrong shortNameMax constant that failed to account for the obligatory padding byte. Fix the constant and also expand the TestLongnameStat test case to test ALL file name lengths from 1-255 bytes. Fixes https://github.com/rfjakob/gocryptfs/issues/143 . --- tests/example_filesystems/example_filesystems_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/example_filesystems') diff --git a/tests/example_filesystems/example_filesystems_test.go b/tests/example_filesystems/example_filesystems_test.go index cbea251..0732eb6 100644 --- a/tests/example_filesystems/example_filesystems_test.go +++ b/tests/example_filesystems/example_filesystems_test.go @@ -254,6 +254,8 @@ func TestExampleFSv13(t *testing.T) { // gocryptfs v1.3 introduced HKDF. // We check the md5 sum of the encrypted version of a file to make sure we don't // accidentially change the ciphertext generation. +// Create a full crypto round-trip by mounting two times: +// dirA -> reverse mount -> dirB -> forward mount -> dirC func TestExampleFSv13reverse(t *testing.T) { // Prepare directories dirA := "v1.3-reverse" -- cgit v1.2.3