f2fs: verify ciphertext of compressed+encrypted file
authorEric Biggers <ebiggers@google.com>
Thu, 1 Oct 2020 00:25:07 +0000 (17:25 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Oct 2020 03:28:04 +0000 (11:28 +0800)
commit8b28dae4ac8c0cc614033df04eef2b5ce21b4458
treea5c254ebdaaca1ceb232137bb221b404fc3d49e3
parent4057f495d572437d137fbe76f40563df8ee8b6fb
f2fs: verify ciphertext of compressed+encrypted file

In Linux v5.6, f2fs added support for per-file compression.  f2fs
compression can be used in combination with the existing f2fs encryption
support (a.k.a. fscrypt), in which case the compressed data is encrypted
rather than the uncompressed data.

We need to verify that the encryption is actually being done as expected
in this case.  So add a test which verifies it.

For now this is a f2fs-specific test.  It's possible that ext4 will
implement compression in the same way as f2fs (in which case this could
be made a generic test), but for now there are no plans for that.

This complements the existing ciphertext verification tests, e.g.
generic/548, which don't handle compression.  Encryption+compression has
some unique considerations, so it requires its own test.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Daeho Jeong <daeho43@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/config
tests/f2fs/002 [new file with mode: 0755]
tests/f2fs/002.out [new file with mode: 0644]
tests/f2fs/group