# HG changeset patch # User CamVan Nguyen # Date 1519307715 -28800 # Node ID 3616ec41d03d80b0d1ace9a8aed37d6ecdac9c5b # Parent fa733a314beefa47d677790c6e2c5e409a4e1495 Only load dropbear default host keys if a key is not specified diff -r fa733a314bee -r 3616ec41d03d svr-runopts.c --- a/svr-runopts.c Tue Feb 20 16:13:42 2018 +0100 +++ b/svr-runopts.c Thu Feb 22 21:55:15 2018 +0800 @@ -510,17 +510,20 @@ 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) {