generic: test that encryption nonces are unique and random
authorEric Biggers <ebiggers@google.com>
Sat, 31 Oct 2020 07:23:44 +0000 (00:23 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Nov 2020 16:25:08 +0000 (00:25 +0800)
commitb09ba3318ebb2373df2ee516ee99aae4da24a8a3
tree38d50bf51b227ae4abd87b19e35da510264a4c64
parent59b43407a9cc19574da396ee07318dc21d55d5cd
generic: test that encryption nonces are unique and random

Test that encryption nonces are unique and random, where randomness is
approximated as "incompressible by the xz program".

This gets indirectly tested by generic/399, but there are some gaps.
It's good to test for this directly too.

This test runs and passes on ext4 and f2fs.  It doesn't currently run on
ubifs because _get_encryption_nonce() isn't implemented for ubifs yet.
(At some point I'll probably switch _get_encryption_nonce() to use
FS_IOC_GET_ENCRYPTION_NONCE, which was added in Linux 5.7.  But for now
I'd like to keep the tests using it runnable on older kernels too.)

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/613 [new file with mode: 0755]
tests/generic/613.out [new file with mode: 0644]
tests/generic/group