From 82e9055c49a6bceff3e32757cb4c0f10f46468ae Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 18 Oct 2018 16:37:07 +0200 Subject: mkfs.ubifs: Accept 0x prefix for key descriptor Signed-off-by: David Oberhollenzer Signed-off-by: Richard Weinberger --- ubifs-utils/mkfs.ubifs/fscrypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.c b/ubifs-utils/mkfs.ubifs/fscrypt.c index 6d1fa4b..02132e2 100644 --- a/ubifs-utils/mkfs.ubifs/fscrypt.c +++ b/ubifs-utils/mkfs.ubifs/fscrypt.c @@ -165,6 +165,9 @@ static int parse_key_descriptor(const char *desc, __u8 *dst) { int i, hi, lo; + if (desc[0] == '0' && (desc[1] == 'x' || desc[1] == 'X')) + desc += 2; + for (i = 0; i < FS_KEY_DESCRIPTOR_SIZE; ++i) { if (!desc[i * 2] || !desc[i * 2 + 1]) { err_msg("key descriptor '%s' is too short", desc); -- cgit v1.2.3