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 e2dd67d68..e2e2ef498 100644
--- a/ssh.c
+++ b/ssh.c
@@ -383,7 +383,12 @@ main(int ac, char **av)
383 } 383 }
384 break; 384 break;
385 case 'q': 385 case 'q':
386 options.log_level = SYSLOG_LEVEL_QUIET; 386 if (options.log_level == SYSLOG_LEVEL_QUIET) {
387 options.log_level = SYSLOG_LEVEL_SILENT;
388 }
389 else if (options.log_level != SYSLOG_LEVEL_SILENT) {
390 options.log_level = SYSLOG_LEVEL_QUIET;
391 }
387 break; 392 break;
388 case 'e': 393 case 'e':
389 if (optarg[0] == '^' && optarg[2] == 0 && 394 if (optarg[0] == '^' && optarg[2] == 0 &&
@@ -602,7 +607,7 @@ main(int ac, char **av)
602 tty_flag = 0; 607 tty_flag = 0;
603 /* Do not allocate a tty if stdin is not a tty. */ 608 /* Do not allocate a tty if stdin is not a tty. */
604 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { 609 if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) {
605 if (tty_flag) 610 if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET)
606 logit("Pseudo-terminal will not be allocated because " 611 logit("Pseudo-terminal will not be allocated because "
607 "stdin is not a terminal."); 612 "stdin is not a terminal.");
608 tty_flag = 0; 613 tty_flag = 0;
@@ -1230,7 +1235,7 @@ ssh_session2(void)
1230static void 1235static void
1231load_public_identity_files(void) 1236load_public_identity_files(void)
1232{ 1237{
1233 char *filename, *cp, thishost[NI_MAXHOST]; 1238 char *filename, *cp, thishost[NI_MAXHOST], *fp;
1234 char *pwdir = NULL, *pwname = NULL; 1239 char *pwdir = NULL, *pwname = NULL;
1235 int i = 0; 1240 int i = 0;
1236 Key *public; 1241 Key *public;
@@ -1277,6 +1282,22 @@ load_public_identity_files(void)
1277 public = key_load_public(filename, NULL); 1282 public = key_load_public(filename, NULL);
1278 debug("identity file %s type %d", filename, 1283 debug("identity file %s type %d", filename,
1279 public ? public->type : -1); 1284 public ? public->type : -1);
1285 if (public && blacklisted_key(public, &fp) == 1) {
1286 if (options.use_blacklisted_keys)
1287 logit("Public key %s blacklisted (see "
1288 "ssh-vulnkey(1)); continuing anyway", fp);
1289 else
1290 logit("Public key %s blacklisted (see "
1291 "ssh-vulnkey(1)); refusing to send it",
1292 fp);
1293 xfree(fp);
1294 if (!options.use_blacklisted_keys) {
1295 key_free(public);
1296 xfree(filename);
1297 filename = NULL;
1298 public = NULL;
1299 }
1300 }
1280 xfree(options.identity_files[i]); 1301 xfree(options.identity_files[i]);
1281 options.identity_files[i] = filename; 1302 options.identity_files[i] = filename;
1282 options.identity_keys[i] = public; 1303 options.identity_keys[i] = public;