diff mbox series

[38/42] mkfs.ubifs: More fscryptctl compatibility

Message ID 20181018143718.26298-39-richard@nod.at
State Accepted
Delegated to: David Oberhollenzer
Headers show
Series mtd-utils: Add fscrypt support to mkfs.ubifs | expand

Commit Message

Richard Weinberger Oct. 18, 2018, 2:37 p.m. UTC
fscryptctl reads up to FS_MAX_KEY_SIZE bytes from the source key
to compute the descriptor.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 ubifs-utils/mkfs.ubifs/fscrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.c b/ubifs-utils/mkfs.ubifs/fscrypt.c
index 29dad1b039e7..3d4bff618050 100644
--- a/ubifs-utils/mkfs.ubifs/fscrypt.c
+++ b/ubifs-utils/mkfs.ubifs/fscrypt.c
@@ -202,7 +202,7 @@  static int load_master_key(const char *key_file, struct cipher *fsc)
 		return -1;
 	}
 
-	keysize = read(kf, fscrypt_masterkey, fsc->key_length);
+	keysize = read(kf, fscrypt_masterkey, FS_MAX_KEY_SIZE);
 	if (keysize < 0) {
 		sys_errmsg("read '%s'", key_file);
 		goto fail;