summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2015-08-22 10:05:45 +0100
committerColin Watson <cjwatson@debian.org>2015-08-22 10:05:45 +0100
commit58ddb8ad21f21f5358db0204c4ba9abf94a1ca11 (patch)
treec55df1f23e6fa0fb87a96d8ec4c06a68c3a82b45 /ssh.c
parent544df7a04ae5b5c1fc30be7c445ad685d7a02dc9 (diff)
parent1dc8d93ce69d6565747eb44446ed117187621b26 (diff)
Import openssh_7.0p1.orig.tar.gz
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/ssh.c b/ssh.c
index 3fd5a941f..59c1f931c 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.418 2015/05/04 06:10:48 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.420 2015/07/30 00:01:34 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -108,6 +108,7 @@
108#include "roaming.h" 108#include "roaming.h"
109#include "version.h" 109#include "version.h"
110#include "ssherr.h" 110#include "ssherr.h"
111#include "myproposal.h"
111 112
112#ifdef ENABLE_PKCS11 113#ifdef ENABLE_PKCS11
113#include "ssh-pkcs11.h" 114#include "ssh-pkcs11.h"
@@ -203,10 +204,10 @@ usage(void)
203"usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]\n" 204"usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]\n"
204" [-D [bind_address:]port] [-E log_file] [-e escape_char]\n" 205" [-D [bind_address:]port] [-E log_file] [-e escape_char]\n"
205" [-F configfile] [-I pkcs11] [-i identity_file]\n" 206" [-F configfile] [-I pkcs11] [-i identity_file]\n"
206" [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]\n" 207" [-L address] [-l login_name] [-m mac_spec]\n"
207" [-O ctl_cmd] [-o option] [-p port]\n" 208" [-O ctl_cmd] [-o option] [-p port]\n"
208" [-Q cipher | cipher-auth | mac | kex | key]\n" 209" [-Q cipher | cipher-auth | mac | kex | key]\n"
209" [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]\n" 210" [-R address] [-S ctl_path] [-W host:port]\n"
210" [-w local_tun[:remote_tun]] [user@]hostname [command]\n" 211" [-w local_tun[:remote_tun]] [user@]hostname [command]\n"
211 ); 212 );
212 exit(255); 213 exit(255);
@@ -794,26 +795,26 @@ main(int ac, char **av)
794 } 795 }
795 break; 796 break;
796 case 'c': 797 case 'c':
797 if (ciphers_valid(optarg)) { 798 if (ciphers_valid(*optarg == '+' ?
799 optarg + 1 : optarg)) {
798 /* SSH2 only */ 800 /* SSH2 only */
799 options.ciphers = xstrdup(optarg); 801 options.ciphers = xstrdup(optarg);
800 options.cipher = SSH_CIPHER_INVALID; 802 options.cipher = SSH_CIPHER_INVALID;
801 } else { 803 break;
802 /* SSH1 only */ 804 }
803 options.cipher = cipher_number(optarg); 805 /* SSH1 only */
804 if (options.cipher == -1) { 806 options.cipher = cipher_number(optarg);
805 fprintf(stderr, 807 if (options.cipher == -1) {
806 "Unknown cipher type '%s'\n", 808 fprintf(stderr, "Unknown cipher type '%s'\n",
807 optarg); 809 optarg);
808 exit(255); 810 exit(255);
809 }
810 if (options.cipher == SSH_CIPHER_3DES)
811 options.ciphers = "3des-cbc";
812 else if (options.cipher == SSH_CIPHER_BLOWFISH)
813 options.ciphers = "blowfish-cbc";
814 else
815 options.ciphers = (char *)-1;
816 } 811 }
812 if (options.cipher == SSH_CIPHER_3DES)
813 options.ciphers = xstrdup("3des-cbc");
814 else if (options.cipher == SSH_CIPHER_BLOWFISH)
815 options.ciphers = xstrdup("blowfish-cbc");
816 else
817 options.ciphers = xstrdup(KEX_CLIENT_ENCRYPT);
817 break; 818 break;
818 case 'm': 819 case 'm':
819 if (mac_valid(optarg)) 820 if (mac_valid(optarg))