Просмотр исходного кода

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

default 3 лет назад
Родитель
Сommit
832bbfd5eb
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      activitypub.c

+ 8 - 0
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;
     }