chiark / gitweb /
site: Include key indices in log output
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Nov 2019 01:39:23 +0000 (01:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:51 +0000 (21:56 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c

diff --git a/site.c b/site.c
index a73dcac0d1ef6af10efc60945735daeba50927cc..5d2f519e482b8bbcc0fc299a33f3d40a10569a23 100644 (file)
--- a/site.c
+++ b/site.c
@@ -711,8 +711,8 @@ static bool_t generate_msg(struct site *st, uint32_t type, cstring_t what,
        return False;
 
     privkey_found:
-       slog(st,LOG_SIGKEYS,"using private key " SIGKEYID_PR_FMT,
-            SIGKEYID_PR_VAL(prompt->pubkeys_accepted[ki]));
+       slog(st,LOG_SIGKEYS,"using private key #%d " SIGKEYID_PR_FMT,
+            ki, SIGKEYID_PR_VAL(prompt->pubkeys_accepted[ki]));
        buf_append_uint8(&st->buffer,ki);
     }
 
@@ -1091,11 +1091,12 @@ static bool_t process_msg3_msg4(struct site *st, struct msg *m)
                       m->hashstart,m->hashlen,
                       &m->sig)) {
        slog(st,LOG_SEC,"msg3/msg4 signature failed check!"
-            " (key " SIGKEYID_PR_FMT ")",
-            SIGKEYID_PR_VAL(&st->peerkeys_kex->keys[ki].id));
+            " (key #%d " SIGKEYID_PR_FMT ")",
+            ki, SIGKEYID_PR_VAL(&st->peerkeys_kex->keys[ki].id));
        return False;
     }
-    slog(st,LOG_SIGKEYS,"verified peer signature with key " SIGKEYID_PR_FMT,
+    slog(st,LOG_SIGKEYS,"verified peer signature with key #%d "
+        SIGKEYID_PR_FMT, ki,
         SIGKEYID_PR_VAL(&st->peerkeys_kex->keys[ki].id));
 
     st->remote_adv_mtu=m->remote_mtu;