log: add easy way to log hex blobs.

Use it in one case, and also fix another logging FIXME.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-08-31 16:06:32 +09:30
parent 87af51a422
commit bb0bf2b5ad
4 changed files with 42 additions and 4 deletions

View File

@@ -495,8 +495,9 @@ static struct io_plan *keys_exchanged(struct io_conn *conn,
neg->their_sessionpubkey,
sizeof(neg->their_sessionpubkey),
&sessionkey)) {
/* FIXME: Dump key in this case. */
log_unusual(neg->log, "Bad sessionkey");
log_unusual_blob(neg->log, "Bad sessionkey %s",
neg->their_sessionpubkey,
sizeof(neg->their_sessionpubkey));
return io_close(conn);
}