summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.h
AgeCommit message (Collapse)Author
2023-09-05util/nvmutil: put code all in nvmutil.cLeah Rowe
it doesn't really make sense to have nvmutil.h since this is only a very small program and not intended for use as a library Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-03util/nvmutil: major cleanup. simpler arg handling.Leah Rowe
Also hardened the pledges. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-02util/nvmutil: simplify writeGbeFile()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: code cleanup (pledge/unveil calls)Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: harden pledge/unveil calls (OpenBSD)Leah Rowe
*Open* files at the start, then unveil. The same overall behaviour is observed. In the case that invalid arguments are given, simply opening a file does not cause much performance impact (if any). Restrict operations as early as possible in code. Bonus: writeGbeFile also hardened; if flags is O_RDONLY, it aborts. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: fix faulty fd checkLeah Rowe
i screwed up in an earlier commit this change fixes a bug where on rhex(), each call would re-open /dev/urandom, resetting rfd Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: clean up rhex()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: check correct return value on close()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: massive code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: move includes to nvmutil.hLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: move xpledge/xunveil to nvmutil.hLeah Rowe
They don't precisely *pertain* to nvmutil, but they are useful helper functions for calling pledge/unveil in OpenBSD. Ideally, the main file should only contain core logic pertaining to the execution of *nvmutil*. Put xpledge() and xunveil() in nvmutil.h. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: use SPDX license headersLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-01util/nvmutil: move non-functions to nvmutil.hLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>