summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-05-26 12:19:17 +1000
committerDamien Miller <djm@mindrot.org>2005-05-26 12:19:17 +1000
commit3710f278ae76751118fb3ced2ee6e8e320b91002 (patch)
tree049c62a80c0ad073f0b20c1fd7d330d7bcadfb7d
parentb089fb5fe15a6b1936262a33417265f8cb9b0afb (diff)
- djm@cvs.openbsd.org 2005/05/23 23:32:46
[cipher.c myproposal.h ssh.1 ssh_config.5 sshd_config.5] add support for draft-harris-ssh-arcfour-fixes-02 improved arcfour modes; ok markus@
-rw-r--r--ChangeLog6
-rw-r--r--cipher.c61
-rw-r--r--myproposal.h5
-rw-r--r--ssh.19
-rw-r--r--ssh_config.59
-rw-r--r--sshd_config.59
6 files changed, 64 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index caf31ec86..0418ae55f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,10 @@
76 - removes signed/unsigned comparisons in moduli generation 76 - removes signed/unsigned comparisons in moduli generation
77 - use strtonum instead of atoi where its easier 77 - use strtonum instead of atoi where its easier
78 - check some strlcpy overflow and fatal instead of truncate 78 - check some strlcpy overflow and fatal instead of truncate
79 - djm@cvs.openbsd.org 2005/05/23 23:32:46
80 [cipher.c myproposal.h ssh.1 ssh_config.5 sshd_config.5]
81 add support for draft-harris-ssh-arcfour-fixes-02 improved arcfour modes;
82 ok markus@
79 83
8020050524 8420050524
81 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] 85 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
@@ -2575,4 +2579,4 @@
2575 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 2579 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
2576 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 2580 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
2577 2581
2578$Id: ChangeLog,v 1.3783 2005/05/26 02:16:18 djm Exp $ 2582$Id: ChangeLog,v 1.3784 2005/05/26 02:19:17 djm Exp $
diff --git a/cipher.c b/cipher.c
index beba4618d..b56492940 100644
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: cipher.c,v 1.73 2005/01/23 10:18:12 djm Exp $"); 38RCSID("$OpenBSD: cipher.c,v 1.74 2005/05/23 23:32:46 djm Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "log.h" 41#include "log.h"
@@ -74,39 +74,42 @@ struct Cipher {
74 int number; /* for ssh1 only */ 74 int number; /* for ssh1 only */
75 u_int block_size; 75 u_int block_size;
76 u_int key_len; 76 u_int key_len;
77 u_int discard_len;
77 const EVP_CIPHER *(*evptype)(void); 78 const EVP_CIPHER *(*evptype)(void);
78} ciphers[] = { 79} ciphers[] = {
79 { "none", SSH_CIPHER_NONE, 8, 0, EVP_enc_null }, 80 { "none", SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null },
80 { "des", SSH_CIPHER_DES, 8, 8, EVP_des_cbc }, 81 { "des", SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc },
81 { "3des", SSH_CIPHER_3DES, 8, 16, evp_ssh1_3des }, 82 { "3des", SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des },
82 { "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, evp_ssh1_bf }, 83 { "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf },
83 84
84 { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, EVP_des_ede3_cbc }, 85 { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc },
85 { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_bf_cbc }, 86 { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc },
86 { "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_cast5_cbc }, 87 { "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc },
87 { "arcfour", SSH_CIPHER_SSH2, 8, 16, EVP_rc4 }, 88 { "arcfour", SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 },
89 { "arcfour128", SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 },
90 { "arcfour256", SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 },
88#if OPENSSL_VERSION_NUMBER < 0x00907000L 91#if OPENSSL_VERSION_NUMBER < 0x00907000L
89 { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, evp_rijndael }, 92 { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, evp_rijndael },
90 { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, evp_rijndael }, 93 { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, evp_rijndael },
91 { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, evp_rijndael }, 94 { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, evp_rijndael },
92 { "rijndael-cbc@lysator.liu.se", 95 { "rijndael-cbc@lysator.liu.se",
93 SSH_CIPHER_SSH2, 16, 32, evp_rijndael }, 96 SSH_CIPHER_SSH2, 16, 32, 0, evp_rijndael },
94#else 97#else
95 { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, EVP_aes_128_cbc }, 98 { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc },
96 { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, EVP_aes_192_cbc }, 99 { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc },
97 { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc }, 100 { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
98 { "rijndael-cbc@lysator.liu.se", 101 { "rijndael-cbc@lysator.liu.se",
99 SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc }, 102 SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
100#endif 103#endif
101#if OPENSSL_VERSION_NUMBER >= 0x00905000L 104#if OPENSSL_VERSION_NUMBER >= 0x00905000L
102 { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr }, 105 { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr },
103 { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr }, 106 { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr },
104 { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr }, 107 { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr },
105#endif 108#endif
106#if defined(EVP_CTRL_SET_ACSS_MODE) 109#if defined(EVP_CTRL_SET_ACSS_MODE)
107 { "acss@openssh.org", SSH_CIPHER_SSH2, 16, 5, EVP_acss }, 110 { "acss@openssh.org", SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss },
108#endif 111#endif
109 { NULL, SSH_CIPHER_INVALID, 0, 0, NULL } 112 { NULL, SSH_CIPHER_INVALID, 0, 0, 0, NULL }
110}; 113};
111 114
112/*--*/ 115/*--*/
@@ -224,6 +227,7 @@ cipher_init(CipherContext *cc, Cipher *cipher,
224 const EVP_CIPHER *type; 227 const EVP_CIPHER *type;
225#endif 228#endif
226 int klen; 229 int klen;
230 u_char *junk, *discard;
227 231
228 if (cipher->number == SSH_CIPHER_DES) { 232 if (cipher->number == SSH_CIPHER_DES) {
229 if (dowarn) { 233 if (dowarn) {
@@ -271,6 +275,17 @@ cipher_init(CipherContext *cc, Cipher *cipher,
271 fatal("cipher_init: EVP_CipherInit: set key failed for %s", 275 fatal("cipher_init: EVP_CipherInit: set key failed for %s",
272 cipher->name); 276 cipher->name);
273#endif 277#endif
278
279 if (cipher->discard_len > 0) {
280 junk = xmalloc(cipher->discard_len);
281 discard = xmalloc(cipher->discard_len);
282 if (EVP_Cipher(&cc->evp, discard, junk,
283 cipher->discard_len) == 0)
284 fatal("evp_crypt: EVP_Cipher failed during discard");
285 memset(discard, 0, cipher->discard_len);
286 xfree(junk);
287 xfree(discard);
288 }
274} 289}
275 290
276void 291void
diff --git a/myproposal.h b/myproposal.h
index 228ed6882..2edbe1624 100644
--- a/myproposal.h
+++ b/myproposal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: myproposal.h,v 1.16 2004/06/13 12:53:24 djm Exp $ */ 1/* $OpenBSD: myproposal.h,v 1.17 2005/05/23 23:32:46 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -28,7 +28,8 @@
28 "diffie-hellman-group1-sha1" 28 "diffie-hellman-group1-sha1"
29#define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss" 29#define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss"
30#define KEX_DEFAULT_ENCRYPT \ 30#define KEX_DEFAULT_ENCRYPT \
31 "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \ 31 "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
32 "arcfour128,arcfour256,arcfour," \
32 "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \ 33 "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
33 "aes128-ctr,aes192-ctr,aes256-ctr" 34 "aes128-ctr,aes192-ctr,aes256-ctr"
34#define KEX_DEFAULT_MAC \ 35#define KEX_DEFAULT_MAC \
diff --git a/ssh.1 b/ssh.1
index 05d2234a3..4cc1738c1 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.207 2005/04/21 06:17:50 djm Exp $ 37.\" $OpenBSD: ssh.1,v 1.208 2005/05/23 23:32:46 djm Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
@@ -479,14 +479,17 @@ The supported ciphers are
479.Dq aes128-ctr , 479.Dq aes128-ctr ,
480.Dq aes192-ctr , 480.Dq aes192-ctr ,
481.Dq aes256-ctr , 481.Dq aes256-ctr ,
482.Dq arcfour128 ,
483.Dq arcfour256 ,
482.Dq arcfour , 484.Dq arcfour ,
483.Dq blowfish-cbc , 485.Dq blowfish-cbc ,
484and 486and
485.Dq cast128-cbc . 487.Dq cast128-cbc .
486The default is 488The default is
487.Bd -literal 489.Bd -literal
488 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, 490 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
489 aes192-cbc,aes256-cbc'' 491 arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
492 aes192-ctr,aes256-ctr''
490.Ed 493.Ed
491.It Fl D Ar port 494.It Fl D Ar port
492Specifies a local 495Specifies a local
diff --git a/ssh_config.5 b/ssh_config.5
index 42eefa034..18899ae58 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh_config.5,v 1.53 2005/05/20 11:23:32 jmc Exp $ 37.\" $OpenBSD: ssh_config.5,v 1.54 2005/05/23 23:32:46 djm Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH_CONFIG 5 39.Dt SSH_CONFIG 5
40.Os 40.Os
@@ -193,14 +193,17 @@ The supported ciphers are
193.Dq aes128-ctr , 193.Dq aes128-ctr ,
194.Dq aes192-ctr , 194.Dq aes192-ctr ,
195.Dq aes256-ctr , 195.Dq aes256-ctr ,
196.Dq arcfour128 ,
197.Dq arcfour256 ,
196.Dq arcfour , 198.Dq arcfour ,
197.Dq blowfish-cbc , 199.Dq blowfish-cbc ,
198and 200and
199.Dq cast128-cbc . 201.Dq cast128-cbc .
200The default is 202The default is
201.Bd -literal 203.Bd -literal
202 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, 204 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
203 aes192-cbc,aes256-cbc'' 205 arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
206 aes192-ctr,aes256-ctr''
204.Ed 207.Ed
205.It Cm ClearAllForwardings 208.It Cm ClearAllForwardings
206Specifies that all local, remote and dynamic port forwardings 209Specifies that all local, remote and dynamic port forwardings
diff --git a/sshd_config.5 b/sshd_config.5
index 70d18ab0f..cec2a2382 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: sshd_config.5,v 1.42 2005/05/19 02:39:55 djm Exp $ 37.\" $OpenBSD: sshd_config.5,v 1.43 2005/05/23 23:32:46 djm Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSHD_CONFIG 5 39.Dt SSHD_CONFIG 5
40.Os 40.Os
@@ -168,14 +168,17 @@ The supported ciphers are
168.Dq aes128-ctr , 168.Dq aes128-ctr ,
169.Dq aes192-ctr , 169.Dq aes192-ctr ,
170.Dq aes256-ctr , 170.Dq aes256-ctr ,
171.Dq arcfour128 ,
172.Dq arcfour256 ,
171.Dq arcfour , 173.Dq arcfour ,
172.Dq blowfish-cbc , 174.Dq blowfish-cbc ,
173and 175and
174.Dq cast128-cbc . 176.Dq cast128-cbc .
175The default is 177The default is
176.Bd -literal 178.Bd -literal
177 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, 179 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
178 aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr'' 180 arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
181 aes192-ctr,aes256-ctr''
179.Ed 182.Ed
180.It Cm ClientAliveCountMax 183.It Cm ClientAliveCountMax
181Sets the number of client alive messages (see above) which may be 184Sets the number of client alive messages (see above) which may be