~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyexch: Group element encodings must have constant length.
[tripe]
/
keymgmt.c
diff --git
a/keymgmt.c
b/keymgmt.c
index
c7199e5
..
7163ddd
100644
(file)
--- 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)
*/
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@ --- *
*
/* --- @loadpriv@ --- *
*
@@
-471,7
+477,7
@@
int km_reload(void)
T( trace(T_KEYMGMT, "keymgmt: private keyring updated: reloading..."); )
DRESET(&d);
if (loadpriv(&d))
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;
}
else
reload = 1;
}
@@
-483,7
+489,7
@@
int km_reload(void)
kf = kf_pub;
DRESET(&d);
if (loadpub(&d))
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);
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)) {
/* --- 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;
}
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;
}
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) {
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;
}
goto done;
}
@@
-586,25
+595,34
@@
tymatch:;
*/
if (!group_samep(gg, g)) {
*/
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)) {
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) {
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)) {
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;
}
goto done;
}