diff cli-auth.c @ 681:a4b7627b3157 insecure-nocrypto

Update insecure-nocrypto to current head
author Matt Johnston <matt@ucc.asn.au>
date Wed, 16 May 2012 22:54:51 +0800
parents de3653483ac0 582cb38e4eb5
children 5af8993f7529
line wrap: on
line diff
--- a/cli-auth.c	Wed May 16 21:56:50 2012 +0800
+++ b/cli-auth.c	Wed May 16 22:54:51 2012 +0800
@@ -257,7 +257,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 {
@@ -269,7 +272,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;