diff cli-auth.c @ 686:983a817f8e41 insecure-nocrypto

- Only request "none" cipher after auth has succeeded
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 May 2012 20:52:57 +0800
parents 5af8993f7529
children 714b9106e335
line wrap: on
line diff
--- a/cli-auth.c	Thu May 17 08:33:11 2012 +0800
+++ b/cli-auth.c	Thu May 17 20:52:57 2012 +0800
@@ -257,13 +257,9 @@
 #endif
 
 #ifdef ENABLE_CLI_INTERACT_AUTH
-#if defined(DROPBEAR_NONE_CIPHER) && !defined(ALLOW_NONE_PASSWORD_AUTH)
 	if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
 		fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n");
-	}
-	else 
-#endif
-	if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
+	} else if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
 		if (cli_ses.auth_interact_failed) {
 			finished = 0;
 		} else {
@@ -275,13 +271,9 @@
 #endif
 
 #ifdef ENABLE_CLI_PASSWORD_AUTH
-#if defined(DROPBEAR_NONE_CIPHER) && !defined(ALLOW_NONE_PASSWORD_AUTH)
 	if (ses.keys->trans.algo_crypt->cipherdesc == NULL) {
 		fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n");
-	}
-	else 
-#endif
-	if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
+	} else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
 		cli_auth_password();
 		finished = 1;
 		cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;