Skip to content

Commit

Permalink
writer: Use blocksize constant
Browse files Browse the repository at this point in the history
Drive by cleanup.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Oct 28, 2024
1 parent 8cedf32 commit 5c17ca4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion libcomposefs/lcfs-fsverity.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ struct fsverity_descriptor {
uint8_t reserved2[144];
};

#define FSVERITY_BLOCK_SIZE 4096
#define FSVERITY_MAX_LEVELS 8 /* enough for 64bit file size */

struct FsVerityContext {
Expand Down
2 changes: 2 additions & 0 deletions libcomposefs/lcfs-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ typedef int errint_t;

/* What may be returned by the kernel for digests */
#define MAX_DIGEST_SIZE 64
/* We picked this default block size */
#define FSVERITY_BLOCK_SIZE 4096

#define OVERLAY_XATTR_USER_PREFIX "user."
#define OVERLAY_XATTR_TRUSTED_PREFIX "trusted."
Expand Down
2 changes: 1 addition & 1 deletion libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ int lcfs_fd_enable_fsverity(int fd)

arg.version = 1;
arg.hash_algorithm = FS_VERITY_HASH_ALG_SHA256;
arg.block_size = 4096;
arg.block_size = FSVERITY_BLOCK_SIZE;
arg.salt_size = 0;
arg.salt_ptr = 0;
arg.sig_size = 0;
Expand Down

0 comments on commit 5c17ca4

Please sign in to comment.