<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gocryptfs/internal/nametransform, branch v2.2.0</title>
<subtitle>Mirror of gocryptfs source code on Github</subtitle>
<id>http://nuetzlich.net/cgit/gocryptfs/atom?h=v2.2.0</id>
<link rel='self' href='http://nuetzlich.net/cgit/gocryptfs/atom?h=v2.2.0'/>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/'/>
<updated>2021-08-30T09:31:01+00:00</updated>
<entry>
<title>Unbreak hyperlinks broken by go mod v2 conversion</title>
<updated>2021-08-30T09:31:01+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-30T09:31:01+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=34d8a498c4899b1493f7bea16c22486d6725c9b1'/>
<id>urn:sha1:34d8a498c4899b1493f7bea16c22486d6725c9b1</id>
<content type='text'>
Commit

  69d88505fd7f4cb0d9e4f1918de296342fe05858 go mod: declare module version v2

translated all instances of "github.com/rfjakob/gocryptfs/" to
"github.com/rfjakob/gocryptfs/v2/".

Unfortunately, this included hyperlinks.

Unbreak the hyperlinks like this:

  find . -name \*.go | xargs sed -i s%https://github.com/rfjakob/gocryptfs/v2/%https://github.com/rfjakob/gocryptfs/v2/%
</content>
</entry>
<entry>
<title>go mod: declare module version v2</title>
<updated>2021-08-23T13:05:15+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-23T13:05:15+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=69d88505fd7f4cb0d9e4f1918de296342fe05858'/>
<id>urn:sha1:69d88505fd7f4cb0d9e4f1918de296342fe05858</id>
<content type='text'>
Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
</content>
</entry>
<entry>
<title>Implement -deterministic-names: extended -zerodiriv</title>
<updated>2021-08-20T08:58:42+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-08-20T08:57:26+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=195d9d18a90d88ff2cb0530d832c59d98934fd1f'/>
<id>urn:sha1:195d9d18a90d88ff2cb0530d832c59d98934fd1f</id>
<content type='text'>
-deterministc-names uses all-zero dirivs but does not write
them to disk anymore.
</content>
</entry>
<entry>
<title>Flag -zerodiriv to create all diriv as all zero byte files</title>
<updated>2021-08-19T16:05:54+00:00</updated>
<author>
<name>Jose M Perez</name>
</author>
<published>2021-08-12T20:48:34+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=8f94083a2114c3aef4bc0320065e0374c420ea4a'/>
<id>urn:sha1:8f94083a2114c3aef4bc0320065e0374c420ea4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nametransform: rename BadNameFlag to BadnameSuffix</title>
<updated>2021-06-21T10:12:44+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-06-21T10:12:44+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=05b813f2026ebe6bff33cb600775823ee8a7df6e'/>
<id>urn:sha1:05b813f2026ebe6bff33cb600775823ee8a7df6e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nametransform: gather badname functions in badname.go</title>
<updated>2021-06-21T10:10:04+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-06-21T10:08:18+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=689b74835bd38ebaf87ba0e205c10b9594e51863'/>
<id>urn:sha1:689b74835bd38ebaf87ba0e205c10b9594e51863</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nametransform: delete NameTransformer interface</title>
<updated>2021-06-21T09:53:33+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-06-21T09:53:33+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=2efef1e270a0e374c479326ab2c296b5e9fdc34d'/>
<id>urn:sha1:2efef1e270a0e374c479326ab2c296b5e9fdc34d</id>
<content type='text'>
Useless layer of indirection.
</content>
</entry>
<entry>
<title>nametransform: pass badname patterns via New</title>
<updated>2021-06-20T17:09:46+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-06-20T17:09:46+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=c5d8fa83ae702017fc90769dff178fda6a7942a3'/>
<id>urn:sha1:c5d8fa83ae702017fc90769dff178fda6a7942a3</id>
<content type='text'>
This means we can unexport the field.
</content>
</entry>
<entry>
<title>Badname file content access</title>
<updated>2021-06-20T16:09:21+00:00</updated>
<author>
<name>DerDonut</name>
</author>
<published>2021-06-17T06:11:33+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=a611810ff46ed0899d677f24c330a994ad125bfb'/>
<id>urn:sha1:a611810ff46ed0899d677f24c330a994ad125bfb</id>
<content type='text'>
This proposal is the counterpart of the modifications from the `-badname`
parameter. It modifies the plain -&gt; cipher mapping for filenames when using
`-badname` parameter. The new function `EncryptAndHashBadName` tries to find a
cipher filename for the given plain name with the following steps:

1. If `badname` is disabled or direct mapping is successful: Map directly
(default and current behaviour)

2. If a file with badname flag has a valid cipher file, this is returned
(=File just ends with the badname flag)

3. If a file with a badname flag exists where only the badname flag was added,
this is returned (=File cipher name could not be decrypted by function
`DecryptName` and just the badname flag was added)

4. Search for all files which cipher file name extists when cropping more and
more characters from the end. If only 1 file is found, return this

5. Return an error otherwise

This allows file access in the file browsers but most important it allows that
you rename files with undecryptable cipher names in the plain directories.
Renaming those files will then generate a proper cipher filename One
backdraft: When mounting the cipher dir with -badname parameter, you can never
create (or rename to) files whose file name ends with the badname file flag
(at the moment this is " GOCRYPTFS_BAD_NAME"). This will cause an error.

I modified the CLI test function to cover additional test cases. Test [Case
7](https://github.com/DerDonut/gocryptfs/blob/badnamecontent/tests/cli/cli_test.go#L712)
cannot be performed since the cli tests are executed in panic mode. The
testing is stopped on error. Since the function`DecryptName` produces internal
errors when hitting non-decryptable file names, this test was omitted.

This implementation is a proposal where I tried to change the minimum amount
of existing code. Another possibility would be instead of creating the new
function `EncryptAndHashBadName` to modify the signature of the existing
function `EncryptAndHashName(name string, iv []byte)` to
`EncryptAndHashName(name string, iv []byte, dirfd int)` and integrate the
functionality into this function directly. You may allow calling with dirfd=-1
or other invalid values an then performing the current functionality.
</content>
</entry>
<entry>
<title>nametransform: check name validity on encryption</title>
<updated>2021-06-02T12:29:48+00:00</updated>
<author>
<name>Jakob Unterwurzacher</name>
</author>
<published>2021-06-02T12:21:30+00:00</published>
<link rel='alternate' type='text/html' href='http://nuetzlich.net/cgit/gocryptfs/commit/?id=04858ddd222bbf7156f33f99cfb293a9b1e15ec8'/>
<id>urn:sha1:04858ddd222bbf7156f33f99cfb293a9b1e15ec8</id>
<content type='text'>
xfstests generic/523 discovered that we allowed to set
xattrs with "/" in the name, but did not allow to read
them later.

With this change we do not allow to set them in the first
place.
</content>
</entry>
</feed>
