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