summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/ssh.c b/ssh.c
index e2dd67d68..2b55e6397 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;
@@ -1200,7 +1205,8 @@ ssh_session2(void)
1200 id = ssh_session2_open(); 1205 id = ssh_session2_open();
1201 1206
1202 /* If we don't expect to open a new session, then disallow it */ 1207 /* If we don't expect to open a new session, then disallow it */
1203 if (options.control_master == SSHCTL_MASTER_NO) { 1208 if (options.control_master == SSHCTL_MASTER_NO &&
1209 (datafellows & SSH_NEW_OPENSSH)) {
1204 debug("Requesting no-more-sessions@openssh.com"); 1210 debug("Requesting no-more-sessions@openssh.com");
1205 packet_start(SSH2_MSG_GLOBAL_REQUEST); 1211 packet_start(SSH2_MSG_GLOBAL_REQUEST);
1206 packet_put_cstring("no-more-sessions@openssh.com"); 1212 packet_put_cstring("no-more-sessions@openssh.com");
@@ -1230,7 +1236,7 @@ ssh_session2(void)
1230static void 1236static void
1231load_public_identity_files(void) 1237load_public_identity_files(void)
1232{ 1238{
1233 char *filename, *cp, thishost[NI_MAXHOST]; 1239 char *filename, *cp, thishost[NI_MAXHOST], *fp;
1234 char *pwdir = NULL, *pwname = NULL; 1240 char *pwdir = NULL, *pwname = NULL;
1235 int i = 0; 1241 int i = 0;
1236 Key *public; 1242 Key *public;
@@ -1277,6 +1283,22 @@ load_public_identity_files(void)
1277 public = key_load_public(filename, NULL); 1283 public = key_load_public(filename, NULL);
1278 debug("identity file %s type %d", filename, 1284 debug("identity file %s type %d", filename,
1279 public ? public->type : -1); 1285 public ? public->type : -1);
1286 if (public && blacklisted_key(public, &fp) == 1) {
1287 if (options.use_blacklisted_keys)
1288 logit("Public key %s blacklisted (see "
1289 "ssh-vulnkey(1)); continuing anyway", fp);
1290 else
1291 logit("Public key %s blacklisted (see "
1292 "ssh-vulnkey(1)); refusing to send it",
1293 fp);
1294 xfree(fp);
1295 if (!options.use_blacklisted_keys) {
1296 key_free(public);
1297 xfree(filename);
1298 filename = NULL;
1299 public = NULL;
1300 }
1301 }
1280 xfree(options.identity_files[i]); 1302 xfree(options.identity_files[i]);
1281 options.identity_files[i] = filename; 1303 options.identity_files[i] = filename;
1282 options.identity_keys[i] = public; 1304 options.identity_keys[i] = public;