fix display of message on TOFU_FINGERPRINT_MISMATCH
Previously the message was never displayed to users
leaving them with a simple "Error: certificate is untrusted".
This also fixes the display of line numbers in the message.
Fix OpenBSD compilation errors
Those changes fix the following compilation errors on OpenBSD:
src/tofu.c:128:28: error: format specifies type 'long' but the argument has type
'time_t' (aka 'long long') [-Werror,-Wformat]
"SHA-512", fingerprint, expires);
src/gmnlm.c:341:31: error: missing sentinel in function call
[-Werror,-Wsentinel]
execlp("sh", "sh", "-c", cmd);
^
, NULL
Fix more strncpy bugs in gmnlm and tofu
>From gcc 9.3.0:
error: '__builtin_strncpy' specified bound 4097 equals destination size
[-Werror=stringop-truncation]
Signed-off-by: William Casarin <jb55@jb55.com>
Fix bug on mkdirs calls
On some systems dirname uses a static string for its return value, so
we were calling mkdirs recursively on a string that was continuosly changing.
A check was also added after the `snprintf` to make sure there's no
information loss since there is no limit to the length of the string
returned by `get_data_pathfmt`.
Closes #48.
Add static library for gmni
Init known_hosts prior to fopen to avoid segfault.
Fix truncated hashes in known_hosts
tofu.c: clarify reuse warning
TOFU: use ~/.local/share/gemini/known_hosts
The rest of gmni's stuff will remain in ~/.local/share/gmni, but in
order to establish a common location and format for the TOFU file
between Gemini implementations, a more general path is required.