snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 832bbfd5ebf0c756c65e2e710656b6e875bfeb08
parent a9d3e0ca79543ab6d590000327ae399908b2c8cc
Author: default <nobody@localhost>
Date:   Sun, 27 Nov 2022 09:18:35 +0100

Dump bad signature headers to /tmp/ (temporary).

Diffstat:
Mactivitypub.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/activitypub.c b/activitypub.c @@ -806,6 +806,14 @@ int process_message(snac *snac, char *msg, char *req) /* check the signature */ if (!check_signature(snac, req)) { + { + xs *j = xs_json_dumps_pp(req, 4); + FILE *f; + if ((f = fopen("/tmp/snac-bad-signature.json", "w")) != NULL) { + fwrite(j, strlen(j), 1, f); + fclose(f); + } + } snac_log(snac, xs_fmt("bad signature")); return 1; }