summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/ssh.c b/ssh.c
index adfe60e4b..a72f16c63 100644
--- a/ssh.c
+++ b/ssh.c
@@ -389,7 +389,12 @@ main(int ac, char **av)
389 } 389 }
390 break; 390 break;
391 case 'q': 391 case 'q':
392 options.log_level = SYSLOG_LEVEL_QUIET; 392 if (options.log_level == SYSLOG_LEVEL_QUIET) {
393 options.log_level = SYSLOG_LEVEL_SILENT;
394 }
395 else if (options.log_level != SYSLOG_LEVEL_SILENT) {
396 options.log_level = SYSLOG_LEVEL_QUIET;
397 }
393 break; 398 break;
394 case 'e': 399 case 'e':
395 if (optarg[0] == '^' && optarg[2] == 0 && 400 if (optarg[0] == '^' && optarg[2] == 0 &&
@@ -592,7 +597,7 @@ main(int ac, char **av)
592 tty_flag = 0; 597 tty_flag = 0;
593 /* Do not allocate a tty if stdin is not a tty. */ 598 /* Do not allocate a tty if stdin is not a tty. */
594 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { 599 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) {
595 if (tty_flag) 600 if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET)
596 logit("Pseudo-terminal will not be allocated because " 601 logit("Pseudo-terminal will not be allocated because "
597 "stdin is not a terminal."); 602 "stdin is not a terminal.");
598 tty_flag = 0; 603 tty_flag = 0;
@@ -1229,7 +1234,7 @@ ssh_session2(void)
1229static void 1234static void
1230load_public_identity_files(void) 1235load_public_identity_files(void)
1231{ 1236{
1232 char *filename, *cp, thishost[NI_MAXHOST]; 1237 char *filename, *cp, thishost[NI_MAXHOST], *fp;
1233 char *pwdir = NULL, *pwname = NULL; 1238 char *pwdir = NULL, *pwname = NULL;
1234 int i = 0; 1239 int i = 0;
1235 Key *public; 1240 Key *public;
@@ -1276,6 +1281,22 @@ load_public_identity_files(void)
1276 public = key_load_public(filename, NULL); 1281 public = key_load_public(filename, NULL);
1277 debug("identity file %s type %d", filename, 1282 debug("identity file %s type %d", filename,
1278 public ? public->type : -1); 1283 public ? public->type : -1);
1284 if (public && blacklisted_key(public, &fp) == 1) {
1285 if (options.use_blacklisted_keys)
1286 logit("Public key %s blacklisted (see "
1287 "ssh-vulnkey(1)); continuing anyway", fp);
1288 else
1289 logit("Public key %s blacklisted (see "
1290 "ssh-vulnkey(1)); refusing to send it",
1291 fp);
1292 xfree(fp);
1293 if (!options.use_blacklisted_keys) {
1294 key_free(public);
1295 xfree(filename);
1296 filename = NULL;
1297 public = NULL;
1298 }
1299 }
1279 xfree(options.identity_files[i]); 1300 xfree(options.identity_files[i]);
1280 options.identity_files[i] = filename; 1301 options.identity_files[i] = filename;
1281 options.identity_keys[i] = public; 1302 options.identity_keys[i] = public;