summaryrefslogtreecommitdiff
path: root/cryptfs.cpp
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-01-25 12:11:25 -0800
committerEric Biggers <ebiggers@google.com>2019-01-25 13:42:07 -0800
commite1a7e772699216121dd8fa774381ffeedb076139 (patch)
treefddca2489b011ff62d415d3174775e27f9a6cd68 /cryptfs.cpp
parented45ec3ae8bf2c18f72550bdf660035e2fee6dc4 (diff)
cryptfs: improve logging of dm-crypt device creation
Log the main configuration of the dm-crypt device -- the name, the cipher, the keysize, the real device, and the length -- in addition to the extra parameters which we were already logging. (We can't simply log the actual string passed to the kernel, of course, because that includes the key. So we choose the fields individually.) Test: booted device configured to use FDE and checked the log message Change-Id: Ia95de807c4fad68d93b7e7e73508a01e5139dc76
Diffstat (limited to 'cryptfs.cpp')
-rw-r--r--cryptfs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cryptfs.cpp b/cryptfs.cpp
index 01ac694..7c33449 100644
--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -984,7 +984,10 @@ static int load_crypto_mapping_table(struct crypt_mnt_ftr* crypt_ftr,
convert_key_to_hex_ascii(master_key, crypt_ftr->keysize, master_key_ascii);
buff_offset = crypt_params - buffer;
- SLOGI("Extra parameters for dm_crypt: %s\n", extra_params);
+ SLOGI(
+ "Creating crypto dev \"%s\"; cipher=%s, keysize=%u, real_dev=%s, len=%llu, params=\"%s\"\n",
+ name, crypt_ftr->crypto_type_name, crypt_ftr->keysize, real_blk_name, tgt->length * 512,
+ extra_params);
snprintf(crypt_params, sizeof(buffer) - buff_offset, "%s %s 0 %s 0 %s",
crypt_ftr->crypto_type_name, master_key_ascii, real_blk_name, extra_params);
crypt_params += strlen(crypt_params) + 1;