Commits


code: add wrappers for common failure cases Certain calls to well-known functions sometimes result in similar error handling across the code base. Sometimes there's a need to centralise the failure case. Achieve this for common wrappers to often-used functions. The transformation is achieved via coccinelle, commited with this patch. Note that coccinelle can be told to ignore code blocks with comment delimiters. This transformation applies just to telescope's code, and not any of the bundled depdencies in telescope (libgrapheme).


move tofu declarations to their own header While here replace GEMINI_URL_LEN with TOFU_URL_MAX_LEN to avoid a dependency on telescope.h. Ideally, we should move this stuff to another header that comes with less dependencies.


check explicitly for -1


merge update_cert and tofu_update into tofu_update_persist


merge tofu_add and save_cert into tofu_save


move util.c declarations in utils.h it's not spelled `util.h' because otherwise it'd get included instead of /usr/include/util.h


de-duplicate hash_* function: collect them in util.c


fmt (some missing space -> tab conversion)


fix two related bug Don't crash when there's a certificate mismatch and after saving the cert, before choosing to persist it, the page gets redirected; also, don't repeat the "Certificate mismatch" after the first yes, if there's a redirect. Now when the user accept a certificate, is treated as temporary saved for the whole session.


allow saving the new certificate after mismatch


hash.c -> tofu.c