From ac3a27f5170d199ad452e29ce7f78a6f5d0be913 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 19 May 2018 18:13:46 +0100 Subject: [PATCH] server/keymgmt.c: Replace ad-hoc `die' with an `ABORT'-level warning. It's either this or an `assert', and for some reason I didn't do that the first time. --- server/keymgmt.c | 6 ++++-- server/tripe-admin.5.in | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/server/keymgmt.c b/server/keymgmt.c index 6ee65bcd..05e01068 100644 --- a/server/keymgmt.c +++ b/server/keymgmt.c @@ -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(); } } diff --git a/server/tripe-admin.5.in b/server/tripe-admin.5.in index 86fe3149..bd0635e5 100644 --- a/server/tripe-admin.5.in +++ b/server/tripe-admin.5.in @@ -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 -- 2.11.0