From c35839afbcaf7cda806045a04cff5b51275c3421 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 7 Jun 2012 15:19:19 +0200 Subject: [PATCH] Use configure for defaults. --- configure.in | 5 +++++ src/veritysetup.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 7d92dd1..eed14fc 100644 --- a/configure.in +++ b/configure.in @@ -343,6 +343,11 @@ CS_NUM_WITH([loopaes-keybits],[key length in bits for loop-AES mode], [256]) CS_NUM_WITH([keyfile-size-maxkb],[maximum keyfile size (in kilobytes)], [8192]) CS_NUM_WITH([passphrase-size-max],[maximum keyfile size (in kilobytes)], [512]) +CS_STR_WITH([verity-hash], [hash function for verity mode], [sha256]) +CS_NUM_WITH([verity-data-block], [data block size for verity mode], [4096]) +CS_NUM_WITH([verity-hash-block], [hash block size for verity mode], [4096]) +CS_NUM_WITH([verity-salt-size], [salt size for verity mode], [32]) + dnl ========================================================================== AC_CONFIG_FILES([ Makefile diff --git a/src/veritysetup.c b/src/veritysetup.c index 5ec7abd..e6a08e4 100644 --- a/src/veritysetup.c +++ b/src/veritysetup.c @@ -23,7 +23,6 @@ * - audit alloc errors / error path * - change command names (cryptsetup style) * - extend superblock (UUID) - * - configure.in/config.h defaults */ #include @@ -52,13 +51,13 @@ static const char *hash_algorithm = NULL; static const char *root_hash = NULL; static int version = 1; -static int data_block_size = 4096; -static int hash_block_size = 4096; +static int data_block_size = DEFAULT_VERITY_DATA_BLOCK; +static int hash_block_size = DEFAULT_VERITY_HASH_BLOCK; static char *data_blocks_string = NULL; static uint64_t data_blocks = 0; static char *hash_start_string = NULL; static const char *salt_string = NULL; -static unsigned salt_size = 32; +static unsigned salt_size = DEFAULT_VERITY_SALT_SIZE; static uint64_t hash_start = 0; static int opt_verbose = 0; @@ -209,7 +208,7 @@ static int action_create(void) if ((r = crypt_init(&cd, hash_device))) goto out; - params.hash_name = hash_algorithm ?: "sha256"; + params.hash_name = hash_algorithm ?: DEFAULT_VERITY_HASH; params.data_device = data_device; if (salt_string) { -- 2.7.4