From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-fscrypt@vger.kernel.org
Subject: [PATCH v3 03/10] common/verity: use FSV_BLOCK_SIZE by default
Date: Thu, 29 Dec 2022 15:32:15 -0800 [thread overview]
Message-ID: <20221229233222.119630-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20221229233222.119630-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
Make _fsv_enable() and _fsv_sign() default to FSV_BLOCK_SIZE if no block
size is explicitly specified, so that the individual tests don't have to
do this themselves. This overrides the fsverity-utils default of 4096
bytes, or the page size in older versions of fsverity-utils, both of
which may differ from FSV_BLOCK_SIZE.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
common/verity | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/common/verity b/common/verity
index a94ebf8e..1c706b80 100644
--- a/common/verity
+++ b/common/verity
@@ -249,7 +249,13 @@ _fsv_dump_signature()
_fsv_enable()
{
- $FSVERITY_PROG enable "$@"
+ local args=("$@")
+ # If the caller didn't explicitly specify a Merkle tree block size, then
+ # use FSV_BLOCK_SIZE.
+ if ! [[ " $*" =~ " --block-size" ]]; then
+ args+=("--block-size=$FSV_BLOCK_SIZE")
+ fi
+ $FSVERITY_PROG enable "${args[@]}"
}
_fsv_measure()
@@ -259,7 +265,13 @@ _fsv_measure()
_fsv_sign()
{
- $FSVERITY_PROG sign "$@"
+ local args=("$@")
+ # If the caller didn't explicitly specify a Merkle tree block size, then
+ # use FSV_BLOCK_SIZE.
+ if ! [[ " $*" =~ " --block-size" ]]; then
+ args+=("--block-size=$FSV_BLOCK_SIZE")
+ fi
+ $FSVERITY_PROG sign "${args[@]}"
}
# Generate a file, then enable verity on it.
--
2.39.0
next prev parent reply other threads:[~2022-12-29 23:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-29 23:32 [PATCH v3 00/10] xfstests: update verity tests for non-4K block and page size Eric Biggers
2022-12-29 23:32 ` [PATCH v3 01/10] common/verity: add and use _fsv_can_enable() Eric Biggers
2022-12-29 23:32 ` [PATCH v3 02/10] common/verity: set FSV_BLOCK_SIZE to an appropriate value Eric Biggers
2022-12-29 23:32 ` Eric Biggers [this message]
2022-12-29 23:32 ` [PATCH v3 04/10] common/verity: add _filter_fsverity_digest() Eric Biggers
2022-12-29 23:32 ` [PATCH v3 05/10] generic/572: support non-4K Merkle tree block size Eric Biggers
2022-12-29 23:32 ` [PATCH v3 06/10] generic/573: " Eric Biggers
2022-12-29 23:32 ` [PATCH v3 07/10] generic/577: " Eric Biggers
2022-12-29 23:32 ` [PATCH v3 08/10] generic/574: test multiple Merkle tree block sizes Eric Biggers
2022-12-29 23:32 ` [PATCH v3 09/10] generic/624: " Eric Biggers
2022-12-29 23:32 ` [PATCH v3 10/10] generic/575: test 1K Merkle tree block size Eric Biggers
2023-01-01 13:30 ` [PATCH v3 00/10] xfstests: update verity tests for non-4K block and page size Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221229233222.119630-4-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox