#include <mLib/tv.h>
#include <catacomb/buf.h>
+#include <catacomb/ct.h>
#include <catacomb/dh.h>
#include <catacomb/ec.h>
#include <catacomb/ec-keys.h>
* otherwise write to stderr. Don't use `%m' because that won't work when
* writing to stderr.
*/
-static void complain(int sev, const char *msg, ...)
+static void PRINTF_LIKE(2, 3) complain(int sev, const char *msg, ...)
{
va_list ap;
else {
tsz = atoi(q);
if (tsz <= 0 || tsz%8 || tsz/8 > k->mc->hashsz) {
- complain(LOG_ERR, "bad tag size for mac `%s' in key %s",
+ complain(LOG_ERR, "bad tag size `%s' for mac `%s' in key %s",
q, k->mc->name, d.buf);
goto fail;
}
/* Rate limiting parameters.
*
* There's a probabilistic rate-limiting mechanism. A counter starts at 0.
- * Every time we oricess a request, we increment the counter. The counter
+ * Every time we process a request, we increment the counter. The counter
* drops by RATE_REFILL every second. If the counter is below RATE_CREDIT
* then the request is processed; otherwise it is processed with probability
* 1/(counter - RATE_CREDIT).
return (q);
}
-/* Reransmission and timeout parameters. */
+/* Retransmission and timeout parameters. */
#define TO_NEXT(t) (((t) + 2)*4/3) /* Timeout growth function */
#define TO_MAX 30 /* When to give up */
}
/* Wee whether this corresponds to any of our servers. Don't just
- * check the active servers, since this may be late replies caused by
+ * check the active servers, since this may be late a reply caused by
* retransmissions or similar.
*/
for (q = qq; q; q = q->next) {
h = GM_INIT(m);
GH_HASH(h, p, n);
tt = GH_DONE(h, 0);
- if (memcmp(t, tt, s->k.tagsz) != 0) {
+ if (!ct_memeq(t, tt, s->k.tagsz)) {
moan("incorrect tag from %s:%d",
inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
goto again;
}
static void version(FILE *fp)
- { pquis(fp, "$, version " VERSION); }
+ { pquis(fp, "$, version " VERSION "\n"); }
static void help(FILE *fp)
{