528938d503
The upcoming support for LUKS2 encryption will require a JSON parser to decode all parameters required for decryption of a drive. As there is currently no other tool that requires JSON, and as gnulib does not provide a parser, we need to introduce a new one into the code base. The backend for the JSON implementation is going to be the jsmn library [1]. It has several benefits that make it a very good fit for inclusion in GRUB: - It is licensed under MIT. - It is written in C89. - It has no dependencies, not even libc. - It is small with only about 500 lines of code. - It doesn't do any dynamic memory allocation. - It is testen on x86, amd64, ARM and AVR. The library itself comes as a single header, only, that contains both declarations and definitions. The exposed interface is kind of simplistic, though, and does not provide any convenience features whatsoever. Thus there will be a separate interface provided by GRUB around this parser that is going to be implemented in the following commit. This change only imports jsmn.h from tag v1.1.0 and adds it unmodified to a new json module with the following command: curl -L https://raw.githubusercontent.com/zserge/jsmn/v1.1.0/jsmn.h \ -o grub-core/lib/json/jsmn.h Upstream jsmn commit hash: fdcef3ebf886fa210d14956d3c068a653e76a24e Upstream jsmn commit name: Modernize (#149), 2019-04-20 [1]: https://github.com/zserge/jsmn Signed-off-by: Patrick Steinhardt <ps@pks.im> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> |
||
---|---|---|
.. | ||
arc | ||
arm | ||
arm64 | ||
dummy | ||
efi | ||
emu | ||
gnulib-patches | ||
i386 | ||
ia64 | ||
ieee1275 | ||
json | ||
libgcrypt | ||
libgcrypt_wrap | ||
minilzo | ||
mips | ||
posix_wrap | ||
powerpc | ||
riscv | ||
sparc64 | ||
uboot | ||
x86_64 | ||
xen | ||
xzembed | ||
zstd | ||
adler32.c | ||
arg.c | ||
backtrace.c | ||
cmdline.c | ||
cmos_datetime.c | ||
crc.c | ||
crc64.c | ||
crypto.c | ||
disk.c | ||
division.c | ||
envblk.c | ||
fake_module.c | ||
fdt.c | ||
getline.c | ||
hexdump.c | ||
legacy_parse.c | ||
LzFind.c | ||
LzmaDec.c | ||
LzmaEnc.c | ||
pbkdf2.c | ||
priority_queue.c | ||
progress.c | ||
random.c | ||
reed_solomon.c | ||
relocator.c | ||
setjmp.S | ||
syslinux_parse.c |