From da6eadc840716eb29b0175f39b2790bba166db4a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 16 Nov 2022 15:41:57 +0100 Subject: Add a single, central hex blob decoder Since we need it twice (once for tar, once for the filemap xattr parser), add a single, central implementation to libutil, add a unit test for that implementation and then use it in both libtar and gensquashfs. Signed-off-by: David Oberhollenzer --- include/util/util.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/util/util.h b/include/util/util.h index 0161c2b..787580c 100644 --- a/include/util/util.h +++ b/include/util/util.h @@ -77,4 +77,7 @@ SQFS_INTERNAL int check_file_range_equal(sqfs_file_t *file, void *scratch, size_t scratch_size, sqfs_u64 loc_a, sqfs_u64 loc_b, sqfs_u64 size); +SQFS_INTERNAL int hex_decode(const char *in, size_t in_sz, + sqfs_u8 *out, size_t out_sz); + #endif /* SQFS_UTIL_H */ -- cgit v1.2.3