Only load dropbear default host keys if a key is not specified

This commit is contained in:
CamVan Nguyen 2018-02-22 21:55:15 +08:00
parent 7efe873d73
commit 4c95d595c0

View File

@ -510,6 +510,8 @@ void load_all_hostkeys() {
m_free(hostkey_file); m_free(hostkey_file);
} }
/* Only load default host keys if a host key is not specified by the user */
if (svr_opts.num_hostkey_files == 0) {
#if DROPBEAR_RSA #if DROPBEAR_RSA
loadhostkey(RSA_PRIV_FILENAME, 0); loadhostkey(RSA_PRIV_FILENAME, 0);
#endif #endif
@ -521,6 +523,7 @@ void load_all_hostkeys() {
#if DROPBEAR_ECDSA #if DROPBEAR_ECDSA
loadhostkey(ECDSA_PRIV_FILENAME, 0); loadhostkey(ECDSA_PRIV_FILENAME, 0);
#endif #endif
}
#if DROPBEAR_DELAY_HOSTKEY #if DROPBEAR_DELAY_HOSTKEY
if (svr_opts.delay_hostkey) { if (svr_opts.delay_hostkey) {