diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-12-03 21:13:58 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-12-03 21:13:58 +0800 |
commit | b3cab3ce3163083bbff9561a54369056793ab73d (patch) | |
tree | 75bb9bb603fc3a4f1b5057da86a414031ad4a732 /svr-kex.c | |
parent | e5279b0e2eda6d2e232d816956e6c0deb9aafedd (diff) |
Log when generating a hostkey
Diffstat (limited to 'svr-kex.c')
-rw-r--r-- | svr-kex.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -145,6 +145,20 @@ static void svr_ensure_hostkey() { ret = readhostkey(fn, svr_opts.hostkey, &type); + if (ret == DROPBEAR_SUCCESS) { + char *fp = NULL; + unsigned int len; + buffer *key_buf = buf_new(MAX_PUBKEY_SIZE); + buf_put_pub_key(key_buf, svr_opts.hostkey, type); + buf_setpos(key_buf, 4); + len = key_buf->len - key_buf->pos; + fp = sign_key_fingerprint(buf_getptr(key_buf, len), len); + dropbear_log(LOG_INFO, "Generated hostkey %s, fingerprint is %s", + fn, fp); + m_free(fp); + buf_free(key_buf); + } + out: if (fn_temp) { unlink(fn_temp); |