comparison svr-kex.c @ 875:6c7a15668d5a

Log when generating a hostkey
author Matt Johnston <matt@ucc.asn.au>
date Tue, 03 Dec 2013 21:13:58 +0800
parents 220f55d540ae
children cbc73a5aefb0
comparison
equal deleted inserted replaced
874:68e2a0f6c1ef 875:6c7a15668d5a
143 } 143 }
144 } 144 }
145 145
146 ret = readhostkey(fn, svr_opts.hostkey, &type); 146 ret = readhostkey(fn, svr_opts.hostkey, &type);
147 147
148 if (ret == DROPBEAR_SUCCESS) {
149 char *fp = NULL;
150 unsigned int len;
151 buffer *key_buf = buf_new(MAX_PUBKEY_SIZE);
152 buf_put_pub_key(key_buf, svr_opts.hostkey, type);
153 buf_setpos(key_buf, 4);
154 len = key_buf->len - key_buf->pos;
155 fp = sign_key_fingerprint(buf_getptr(key_buf, len), len);
156 dropbear_log(LOG_INFO, "Generated hostkey %s, fingerprint is %s",
157 fn, fp);
158 m_free(fp);
159 buf_free(key_buf);
160 }
161
148 out: 162 out:
149 if (fn_temp) { 163 if (fn_temp) {
150 unlink(fn_temp); 164 unlink(fn_temp);
151 m_free(fn_temp); 165 m_free(fn_temp);
152 } 166 }