From c852ec8e1a3cd55694d78be13cf62182ee0987eb Mon Sep 17 00:00:00 2001 From: Peter Krefting Date: Fri, 5 Apr 2024 08:37:08 +0100 Subject: [PATCH] Fix compile when disabling SHA-1 Fixes compile when disabling SHA-1 with #define DROPBEAR_SHA1_HMAC 0 #define DROPBEAR_RSA_SHA1 0 #define DROPBEAR_DH_GROUP14_SHA1 0 while keeping SHA-256 enabled. Should also fix the opposite, but that is not a recommended configuration. --- src/svr-runopts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/svr-runopts.c b/src/svr-runopts.c index e8e2f4e6..c4f83c11 100644 --- a/src/svr-runopts.c +++ b/src/svr-runopts.c @@ -610,8 +610,12 @@ void load_all_hostkeys() { #if DROPBEAR_RSA if (!svr_opts.delay_hostkey && !svr_opts.hostkey->rsakey) { +#if DROPBEAR_RSA_SHA256 disablekey(DROPBEAR_SIGNATURE_RSA_SHA256); +#endif +#if DROPBEAR_RSA_SHA1 disablekey(DROPBEAR_SIGNATURE_RSA_SHA1); +#endif } else { any_keys = 1; }