common/encrypt: check that contents encryption is usable
authorEric Biggers <ebiggers@google.com>
Mon, 1 Jul 2019 17:12:55 +0000 (10:12 -0700)
committerEryu Guan <guaneryu@gmail.com>
Fri, 5 Jul 2019 07:19:38 +0000 (15:19 +0800)
commit3eb73bbda3b596b000eddafceddcea8416b9ed27
treedd6d45feb9a434d325e82155ebf52eec2611a691
parentf769a923f576df2d19faf731ee521ea9afe977ce
common/encrypt: check that contents encryption is usable

In _require_encryption_policy_support(), when checking whether the
encryption policy is usable, try creating a nonempty file rather
than an empty one.  This ensures that both the contents and
filenames encryption modes are available, rather than just the
filenames mode.

On f2fs this makes generic/549 be correctly skipped, rather than
failed, when run on a kernel built from the latest fscrypt.git tree
with CONFIG_CRYPTO_SHA256=n.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/encrypt