changeset 876:5bfce5dcd461

Fix disabling DSS key
author Matt Johnston <matt@ucc.asn.au>
date Tue, 03 Dec 2013 21:26:59 +0800
parents 6c7a15668d5a
children 369a811e466a
files svr-runopts.c svr-session.c
diffstat 2 files changed, 9 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/svr-runopts.c	Tue Dec 03 21:13:58 2013 +0800
+++ b/svr-runopts.c	Tue Dec 03 21:26:59 2013 +0800
@@ -475,8 +475,7 @@
 #endif
 
 #ifdef DROPBEAR_DELAY_HOSTKEY
-	if (svr_opts.delay_hostkey)
-	{
+	if (svr_opts.delay_hostkey) {
 		disable_unset_keys = 0;
 	}
 #endif
@@ -484,19 +483,15 @@
 #ifdef DROPBEAR_RSA
 	if (disable_unset_keys && !svr_opts.hostkey->rsakey) {
 		disablekey(DROPBEAR_SIGNKEY_RSA);
-	}
-	else
-	{
+	} else {
 		any_keys = 1;
 	}
 #endif
 
 #ifdef DROPBEAR_DSS
 	if (disable_unset_keys && !svr_opts.hostkey->dsskey) {
-		disablekey(DROPBEAR_SIGNKEY_RSA);
-	}
-	else
-	{
+		disablekey(DROPBEAR_SIGNKEY_DSS);
+	} else {
 		any_keys = 1;
 	}
 #endif
@@ -507,9 +502,7 @@
 	if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 256)
 		&& !svr_opts.hostkey->ecckey256) {
 		disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP256);
-	}
-	else
-	{
+	} else {
 		any_keys = 1;
 	}
 #endif
@@ -518,9 +511,7 @@
 	if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 384)
 		&& !svr_opts.hostkey->ecckey384) {
 		disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP384);
-	}
-	else
-	{
+	} else {
 		any_keys = 1;
 	}
 #endif
@@ -529,17 +520,13 @@
 	if ((disable_unset_keys || ECDSA_DEFAULT_SIZE != 521)
 		&& !svr_opts.hostkey->ecckey521) {
 		disablekey(DROPBEAR_SIGNKEY_ECDSA_NISTP521);
-	}
-	else
-	{
+	} else {
 		any_keys = 1;
 	}
 #endif
 #endif /* DROPBEAR_ECDSA */
 
-	if (!any_keys)
-	{
+	if (!any_keys) {
 		dropbear_exit("No hostkeys available");
 	}
-
 }
--- a/svr-session.c	Tue Dec 03 21:13:58 2013 +0800
+++ b/svr-session.c	Tue Dec 03 21:26:59 2013 +0800
@@ -142,7 +142,7 @@
 	if (!sessinitdone) {
 		/* before session init */
 		snprintf(fmtbuf, sizeof(fmtbuf), 
-				"Premature exit: %s", format);
+				"Early exit: %s", format);
 	} else if (ses.authstate.authdone) {
 		/* user has authenticated */
 		snprintf(fmtbuf, sizeof(fmtbuf),