diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2018-02-22 21:55:15 +0800 |
---|---|---|
committer | CamVan Nguyen <ctnguyen@us.ibm.com> | 2018-02-22 21:55:15 +0800 |
commit | 4c95d595c00818f61905a9d607e3fd675ba85458 (patch) | |
tree | d9568e2ea7f153a27123978963b98f308a9b3586 /svr-runopts.c | |
parent | 7efe873d73362eef8920007e502fcefa504740b1 (diff) |
Only load dropbear default host keys if a key is not specified
Diffstat (limited to 'svr-runopts.c')
-rw-r--r-- | svr-runopts.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svr-runopts.c b/svr-runopts.c index 3d97023..182366f 100644 --- a/svr-runopts.c +++ b/svr-runopts.c @@ -510,17 +510,20 @@ void load_all_hostkeys() { 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 - loadhostkey(RSA_PRIV_FILENAME, 0); + loadhostkey(RSA_PRIV_FILENAME, 0); #endif #if DROPBEAR_DSS - loadhostkey(DSS_PRIV_FILENAME, 0); + loadhostkey(DSS_PRIV_FILENAME, 0); #endif #if DROPBEAR_ECDSA - loadhostkey(ECDSA_PRIV_FILENAME, 0); + loadhostkey(ECDSA_PRIV_FILENAME, 0); #endif + } #if DROPBEAR_DELAY_HOSTKEY if (svr_opts.delay_hostkey) { |