From 844fdd42f03a633f1dbce5d90b2ecf44698cf8b0 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 18 Nov 2022 00:57:01 +0100 Subject: Add a single, central base64 decoder Similar to the hex blob decoder, we need this once for tar and once for the filemap xattr parser. Simply add a single, central implementation to libutil, with a simple unit test, 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/util') diff --git a/include/util/util.h b/include/util/util.h index 787580c..cd32887 100644 --- a/include/util/util.h +++ b/include/util/util.h @@ -80,4 +80,7 @@ SQFS_INTERNAL int check_file_range_equal(sqfs_file_t *file, void *scratch, SQFS_INTERNAL int hex_decode(const char *in, size_t in_sz, sqfs_u8 *out, size_t out_sz); +SQFS_INTERNAL int base64_decode(const char *in, size_t in_len, + sqfs_u8 *out, size_t *out_len); + #endif /* SQFS_UTIL_H */ -- cgit v1.2.3