util: add base64 decoding function
The standard glib provided g_base64_decode doesn't provide any kind of sensible error checking on its input. Add a QEMU custom wrapper qbase64_decode which can be used with untrustworthy input that can contain invalid base64 characters, embedded NUL characters, or not be NUL terminated at all. Reviewed-by:Eric Blake <eblake@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
Showing
- include/qemu/base64.h 58 additions, 0 deletionsinclude/qemu/base64.h
- tests/.gitignore 1 addition, 0 deletionstests/.gitignore
- tests/Makefile 3 additions, 0 deletionstests/Makefile
- tests/test-base64.c 109 additions, 0 deletionstests/test-base64.c
- util/Makefile.objs 1 addition, 0 deletionsutil/Makefile.objs
- util/base64.c 60 additions, 0 deletionsutil/base64.c
include/qemu/base64.h
0 → 100644
tests/test-base64.c
0 → 100644
util/base64.c
0 → 100644
Please register or sign in to comment