summaryrefslogtreecommitdiff
path: root/ubifs-utils/mkfs.ubifs/fscrypt.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-10-18 16:37:17 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2018-11-01 12:42:36 +0100
commit189d8c872bb1ac5a0280fbf232493ad4e15b09f9 (patch)
tree9732191b888609a20ded92cc62c792602ac3ecb3 /ubifs-utils/mkfs.ubifs/fscrypt.c
parentcc4c5e295f5467edf91bb355e3cd525b3279be31 (diff)
mkfs.ubifs: Print key descriptor only when generated
Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/mkfs.ubifs/fscrypt.c')
-rw-r--r--ubifs-utils/mkfs.ubifs/fscrypt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.c b/ubifs-utils/mkfs.ubifs/fscrypt.c
index 3d4bff6..6d2b650 100644
--- a/ubifs-utils/mkfs.ubifs/fscrypt.c
+++ b/ubifs-utils/mkfs.ubifs/fscrypt.c
@@ -65,13 +65,13 @@ void free_fscrypt_context(struct fscrypt_context *fctx)
free(fctx);
}
-void print_fscrypt_master_key_descriptor(struct fscrypt_context *fctx)
+static void print_fscrypt_master_key_descriptor(__u8 *master_key_descriptor)
{
int i;
normsg_cont("fscrypt master key descriptor: 0x");
for (i = 0; i < FS_KEY_DESCRIPTOR_SIZE; i++) {
- printf("%02x", fctx->master_key_descriptor[i]);
+ printf("%02x", master_key_descriptor[i]);
}
printf("\n");
}
@@ -248,6 +248,7 @@ struct fscrypt_context *init_fscrypt_context(const char *cipher_name,
if (!key_descriptor) {
if (derive_key_descriptor(fscrypt_masterkey, master_key_descriptor))
return NULL;
+ print_fscrypt_master_key_descriptor(master_key_descriptor);
} else {
if (parse_key_descriptor(key_descriptor, master_key_descriptor))
return NULL;