summaryrefslogtreecommitdiff
path: root/cli-auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli-auth.c')
-rw-r--r--cli-auth.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli-auth.c b/cli-auth.c
index 6a6d53a..c9aace1 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -251,7 +251,10 @@ void cli_auth_try() {
#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 @@ void cli_auth_try() {
#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;