On Wed, Nov 13, 2019 at 02:22:33PM +0100, Patrick Steinhardt wrote: > 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 <p...@pks.im>
Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com> Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel