From: Nathan Huckleberry Date: Wed, 3 Aug 2022 22:41:21 +0000 (-0700) Subject: generic: add tests for fscrypt policies with HCTR2 X-Git-Tag: v2022.08.07~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94e0bda55b36c899854b056812f72597b9939ac0;p=xfstests-dev.git generic: add tests for fscrypt policies with HCTR2 This patch adds fscrypt policy tests for filename encryption using HCTR2. More information on HCTR2 can be found here: "Length-preserving encryption with HCTR2" https://ia.cr/2021/1441 Signed-off-by: Nathan Huckleberry Reviewed-by: Eric Biggers Tested-by: Eric Biggers Signed-off-by: Zorro Lang --- diff --git a/tests/generic/693 b/tests/generic/693 new file mode 100755 index 00000000..1596865e --- /dev/null +++ b/tests/generic/693 @@ -0,0 +1,31 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2022 Google LLC +# +# FS QA Test No. 693 +# +# Verify ciphertext for v2 encryption policies that use AES-256-XTS to encrypt +# file contents and AES-256-HCTR2 to encrypt file names. +# +# HCTR2 was introduced in kernel commit 6b2a51ff03bf ("fscrypt: Add HCTR2 +# support for filename encryption") +# +. ./common/preamble +_begin_fstest auto quick encrypt + +# Import common functions. +. ./common/filter +. ./common/encrypt + +# real QA test starts here +_supported_fs generic + +_verify_ciphertext_for_encryption_policy AES-256-XTS AES-256-HCTR2 v2 +_verify_ciphertext_for_encryption_policy AES-256-XTS AES-256-HCTR2 \ + v2 iv_ino_lblk_32 +_verify_ciphertext_for_encryption_policy AES-256-XTS AES-256-HCTR2 \ + v2 iv_ino_lblk_64 + +# success, all done +status=0 +exit diff --git a/tests/generic/693.out b/tests/generic/693.out new file mode 100644 index 00000000..91ff7f20 --- /dev/null +++ b/tests/generic/693.out @@ -0,0 +1,16 @@ +QA output created by 693 + +Verifying ciphertext with parameters: + contents_encryption_mode: AES-256-XTS + filenames_encryption_mode: AES-256-HCTR2 + options: v2 + +Verifying ciphertext with parameters: + contents_encryption_mode: AES-256-XTS + filenames_encryption_mode: AES-256-HCTR2 + options: v2 iv_ino_lblk_32 + +Verifying ciphertext with parameters: + contents_encryption_mode: AES-256-XTS + filenames_encryption_mode: AES-256-HCTR2 + options: v2 iv_ino_lblk_64