server/keymgmt.c: Replace ad-hoc `die' with an `ABORT'-level warning.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 19 May 2018 17:13:46 +0000 (18:13 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 25 Jan 2019 12:10:32 +0000 (12:10 +0000)
It's either this or an `assert', and for some reason I didn't do that
the first time.

server/keymgmt.c
server/tripe-admin.5.in

index 6ee65bc..05e0106 100644 (file)
@@ -553,8 +553,10 @@ void km_init(const char *privkr, const char *pubkr, const char *ptag)
 
   for (hh = ghashtab; *hh; hh++) {
     if ((*hh)->hashsz > MAXHASHSZ) {
-      die(EXIT_FAILURE, "INTERNAL ERROR: %s hash length %lu > MAXHASHSZ %d",
-         (*hh)->name, (unsigned long)(*hh)->hashsz, MAXHASHSZ);
+      a_warn("ABORT", "hash-size-too-large", "hash",
+            "%s", (*hh)->name, "size", "%lu", (*hh)->hashsz,
+            "limit", "%d", MAXHASHSZ, A_END);
+      abort();
     }
   }
 
index 86fe314..bd0635e 100644 (file)
@@ -1359,6 +1359,16 @@ core in its configuration directory.
 .BI "ABORT repeated-select-errors"
 The main event loop is repeatedly failing.  If the server doesn't quit,
 it will probably waste all available CPU doing nothing.
+.SP
+.BI "ABORT hash-size-too-large hash " name " size " sz " limit " max
+An internal inconsistency: the hash function
+.I name
+produces a
+.IR sz -byte
+hash, but the server has been compiled to assume that no hash function
+returns more than
+.I max
+bytes.
 .SS "ADMIN warnings"
 These indicate a problem with the administration socket interface.
 .SP