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 b9553d3e1..68178ff95 100644
--- a/ssh.c
+++ b/ssh.c
@@ -421,7 +421,12 @@ main(int ac, char **av)
421 options.exit_on_forward_failure = 1; 421 options.exit_on_forward_failure = 1;
422 break; 422 break;
423 case 'q': 423 case 'q':
424 options.log_level = SYSLOG_LEVEL_QUIET; 424 if (options.log_level == SYSLOG_LEVEL_QUIET) {
425 options.log_level = SYSLOG_LEVEL_SILENT;
426 }
427 else if (options.log_level != SYSLOG_LEVEL_SILENT) {
428 options.log_level = SYSLOG_LEVEL_QUIET;
429 }
425 break; 430 break;
426 case 'e': 431 case 'e':
427 if (optarg[0] == '^' && optarg[2] == 0 && 432 if (optarg[0] == '^' && optarg[2] == 0 &&
@@ -624,7 +629,7 @@ main(int ac, char **av)
624 tty_flag = 0; 629 tty_flag = 0;
625 /* Do not allocate a tty if stdin is not a tty. */ 630 /* Do not allocate a tty if stdin is not a tty. */
626 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { 631 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) {
627 if (tty_flag) 632 if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET)
628 logit("Pseudo-terminal will not be allocated because " 633 logit("Pseudo-terminal will not be allocated because "
629 "stdin is not a terminal."); 634 "stdin is not a terminal.");
630 tty_flag = 0; 635 tty_flag = 0;
@@ -1301,7 +1306,7 @@ ssh_session2(void)
1301static void 1306static void
1302load_public_identity_files(void) 1307load_public_identity_files(void)
1303{ 1308{
1304 char *filename, *cp, thishost[NI_MAXHOST]; 1309 char *filename, *cp, thishost[NI_MAXHOST], *fp;
1305 char *pwdir = NULL, *pwname = NULL; 1310 char *pwdir = NULL, *pwname = NULL;
1306 int i = 0; 1311 int i = 0;
1307 Key *public; 1312 Key *public;
@@ -1358,6 +1363,22 @@ load_public_identity_files(void)
1358 public = key_load_public(filename, NULL); 1363 public = key_load_public(filename, NULL);
1359 debug("identity file %s type %d", filename, 1364 debug("identity file %s type %d", filename,
1360 public ? public->type : -1); 1365 public ? public->type : -1);
1366 if (public && blacklisted_key(public, &fp) == 1) {
1367 if (options.use_blacklisted_keys)
1368 logit("Public key %s blacklisted (see "
1369 "ssh-vulnkey(1)); continuing anyway", fp);
1370 else
1371 logit("Public key %s blacklisted (see "
1372 "ssh-vulnkey(1)); refusing to send it",
1373 fp);
1374 xfree(fp);
1375 if (!options.use_blacklisted_keys) {
1376 key_free(public);
1377 xfree(filename);
1378 filename = NULL;
1379 public = NULL;
1380 }
1381 }
1361 xfree(options.identity_files[i]); 1382 xfree(options.identity_files[i]);
1362 identity_files[n_ids] = filename; 1383 identity_files[n_ids] = filename;
1363 identity_keys[n_ids] = public; 1384 identity_keys[n_ids] = public;