X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/de014da64011b21929158b746803d69cbfb05ee6..5251b2e9939493c088632a548fa61553ff53eae3:/keymgmt.c diff --git a/keymgmt.c b/keymgmt.c index c7199e56..7163ddda 100644 --- a/keymgmt.c +++ b/keymgmt.c @@ -301,7 +301,13 @@ static int algs_samep(const algswitch *a, const algswitch *aa) */ static void keymoan(const char *file, int line, const char *msg, void *p) - { a_warn("KEYMGMT key-file-error %s:%i -- %s", file, line, msg); } +{ + a_warn("KEYMGMT", + "key-file-error", + "%s:%i", file, line, + "%s", msg, + A_END); +} /* --- @loadpriv@ --- * * @@ -471,7 +477,7 @@ int km_reload(void) T( trace(T_KEYMGMT, "keymgmt: private keyring updated: reloading..."); ) DRESET(&d); if (loadpriv(&d)) - a_warn("KEYMGMT bad-private-key -- %s", d.buf); + a_warn("KEYMGMT", "bad-private-key", "%s", d.buf, A_END); else reload = 1; } @@ -483,7 +489,7 @@ int km_reload(void) kf = kf_pub; DRESET(&d); if (loadpub(&d)) - a_warn("KEYMGMT bad-public-keyring -- %s", d.buf); + a_warn("KEYMGMT", "bad-public-keyring", "%s", d.buf, A_END); else { reload = 1; key_close(kf); @@ -558,7 +564,7 @@ int km_getpubkey(const char *tag, ge *kpub, time_t *t_exp) /* --- Find the key --- */ if (key_qtag(kf_pub, tag, &t, &k, &kd)) { - a_warn("KEYMGMT public-key %s not-found", tag); + a_warn("KEYMGMT", "public-key", "%s", tag, "not-found", A_END); goto done; } @@ -568,14 +574,17 @@ int km_getpubkey(const char *tag, ge *kpub, time_t *t_exp) if (strcmp((*ko)->ty, k->type) == 0) goto tymatch; } - a_warn("KEYMGMT public-key %s unknown-type %s", t.buf, k->type); + a_warn("KEYMGMT", + "public-key", "%s", t.buf, + "unknown-type", "%s", k->type, + A_END); goto done; tymatch:; /* --- Load the key --- */ if ((e = (*ko)->loadpub(*kd, &g, &p, &t)) != 0) { - a_warn("KEYMGMT public-key %s bad -- %s", t.buf, e); + a_warn("KEYMGMT", "public-key", "%s", t.buf, "bad", "%s", e, A_END); goto done; } @@ -586,25 +595,34 @@ tymatch:; */ if (!group_samep(gg, g)) { - a_warn("KEYMGMT public-key %s incorrect-group", t.buf); + a_warn("KEYMGMT", "public-key", "%s", t.buf, "incorrect-group", A_END); goto done; } /* --- Check the public group element --- */ if (group_check(gg, p)) { - a_warn("KEYMGMT public-key %s bad-public-group-element", t.buf); + a_warn("KEYMGMT", + "public-key", "%s", t.buf, + "bad-public-group-element", + A_END); goto done; } /* --- Check the algorithms --- */ if ((e = algs_get(&a, kf_pub, k)) != 0) { - a_warn("KEYMGMT public-key %s bad-algorithm-selection %s", t.buf, e); + a_warn("KEYMGMT", + "public-key", "%s", t.buf, + "bad-algorithm-selection", e, + A_END); goto done; } if (!algs_samep(&a, &algs)) { - a_warn("KEYMGMT public-key %s algorithm-mismatch", t.buf); + a_warn("KEYMGMT", + "public-key", "%s", t.buf, + "algorithm-mismatch", + A_END); goto done; }