~sircmpwn/gmni-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH gmni] fix display of message on TOFU_FINGERPRINT_MISMATCH

Details
Message ID
<20210223144306.10057-1-rwagner@rw-net.de>
DKIM signature
pass
Download raw message
Patch: +4 -1
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.
---
 src/gmnlm.c | 2 +-
 src/tofu.c  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index 91e86f0..ee808d0 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -1022,7 +1022,7 @@ tofu_callback(enum tofu_error error, const char *fingerprint,
		free(host);
		break;
	case TOFU_FINGERPRINT_MISMATCH:
		snprintf(prompt, sizeof(prompt),
		fprintf(browser->tty,
			"The certificate offered by this server DOES NOT MATCH the one we have on file.\n"
			"/!\\ Someone may be eavesdropping on or manipulating this connection. /!\\\n"
			"The unknown certificate's fingerprint is:\n"
diff --git a/src/tofu.c b/src/tofu.c
index ba54933..48395c0 100644
--- a/src/tofu.c
+++ b/src/tofu.c
@@ -188,6 +188,7 @@ gemini_tofu_init(struct gemini_tofu *tofu,
		return;
	}
	n = 0;
	int lineno = 1;
	char *line = NULL;
	while (getline(&line, &n, f) != -1) {
		struct known_host *host = calloc(1, sizeof(struct known_host));
@@ -211,6 +212,8 @@ gemini_tofu_init(struct gemini_tofu *tofu,
		assert(tok);
		host->expires = strtoul(tok, NULL, 10);

		host->lineno = lineno++;

		host->next = tofu->known_hosts;
		tofu->known_hosts = host;
	}
-- 
2.30.1
Details
Message ID
<C9H05F7VBPP4.2R5ZB5SZSQ57E@taiga>
In-Reply-To
<20210223144306.10057-1-rwagner@rw-net.de> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   863c41d..529b105  master -> master
Reply to thread Export thread (mbox)