diff cli-auth.c @ 360:09cb54106e89 insecure-nocrypto

explicit merge of '0501e6f661b5415eb76f3b312d183c3adfbfb712' and '2b954d406290e6a2be8eb4a262d3675ac95ac544'
author Matt Johnston <matt@ucc.asn.au>
date Mon, 02 Oct 2006 06:39:32 +0000
parents 64abb124763d
children 582cb38e4eb5
line wrap: on
line diff
--- a/cli-auth.c	Sat Mar 11 14:59:34 2006 +0000
+++ b/cli-auth.c	Mon Oct 02 06:39:32 2006 +0000
@@ -251,7 +251,10 @@
 #endif
 
 #ifdef ENABLE_CLI_INTERACT_AUTH
-	if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
+	if (ses.keys->trans_algo_crypt->cipherdesc == NULL) {
+		fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n");
+	}
+	else if (!finished && ses.authstate.authtypes & AUTH_TYPE_INTERACT) {
 		if (cli_ses.auth_interact_failed) {
 			finished = 0;
 		} else {
@@ -263,7 +266,10 @@
 #endif
 
 #ifdef ENABLE_CLI_PASSWORD_AUTH
-	if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
+	if (ses.keys->trans_algo_crypt->cipherdesc == NULL) {
+		fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n");
+	}
+	else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
 		cli_auth_password();
 		finished = 1;
 		cli_ses.lastauthtype = AUTH_TYPE_PASSWORD;