]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2005/05/23 23:32:46
authordjm <djm>
Thu, 26 May 2005 02:19:17 +0000 (02:19 +0000)
committerdjm <djm>
Thu, 26 May 2005 02:19:17 +0000 (02:19 +0000)
     [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@

ChangeLog
cipher.c
myproposal.h
ssh.1
ssh_config.5
sshd_config.5

index db212a52da92ab015466d557996fa9e15916f47a..7ab291d780790ced8de1f53340b36842bba7fba7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      - removes signed/unsigned comparisons in moduli generation
      - use strtonum instead of atoi where its easier
      - check some strlcpy overflow and fatal instead of truncate
+   - 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@
 
 20050524
  - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
index beba4618dc82d2912fffd2ec32066734a8b59325..b56492940c806114c48ffc843877c891e03dcad1 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.73 2005/01/23 10:18:12 djm Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.74 2005/05/23 23:32:46 djm Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -74,39 +74,42 @@ struct Cipher {
        int     number;         /* for ssh1 only */
        u_int   block_size;
        u_int   key_len;
+       u_int   discard_len;
        const EVP_CIPHER        *(*evptype)(void);
 } ciphers[] = {
-       { "none",               SSH_CIPHER_NONE, 8, 0, EVP_enc_null },
-       { "des",                SSH_CIPHER_DES, 8, 8, EVP_des_cbc },
-       { "3des",               SSH_CIPHER_3DES, 8, 16, evp_ssh1_3des },
-       { "blowfish",           SSH_CIPHER_BLOWFISH, 8, 32, evp_ssh1_bf },
-
-       { "3des-cbc",           SSH_CIPHER_SSH2, 8, 24, EVP_des_ede3_cbc },
-       { "blowfish-cbc",       SSH_CIPHER_SSH2, 8, 16, EVP_bf_cbc },
-       { "cast128-cbc",        SSH_CIPHER_SSH2, 8, 16, EVP_cast5_cbc },
-       { "arcfour",            SSH_CIPHER_SSH2, 8, 16, EVP_rc4 },
+       { "none",               SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null },
+       { "des",                SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc },
+       { "3des",               SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des },
+       { "blowfish",           SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf },
+
+       { "3des-cbc",           SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc },
+       { "blowfish-cbc",       SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc },
+       { "cast128-cbc",        SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc },
+       { "arcfour",            SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 },
+       { "arcfour128",         SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 },
+       { "arcfour256",         SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 },
 #if OPENSSL_VERSION_NUMBER < 0x00907000L
-       { "aes128-cbc",         SSH_CIPHER_SSH2, 16, 16, evp_rijndael },
-       { "aes192-cbc",         SSH_CIPHER_SSH2, 16, 24, evp_rijndael },
-       { "aes256-cbc",         SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
+       { "aes128-cbc",         SSH_CIPHER_SSH2, 16, 16, 0, evp_rijndael },
+       { "aes192-cbc",         SSH_CIPHER_SSH2, 16, 24, 0, evp_rijndael },
+       { "aes256-cbc",         SSH_CIPHER_SSH2, 16, 32, 0, evp_rijndael },
        { "rijndael-cbc@lysator.liu.se",
-                               SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
+                               SSH_CIPHER_SSH2, 16, 32, 0, evp_rijndael },
 #else
-       { "aes128-cbc",         SSH_CIPHER_SSH2, 16, 16, EVP_aes_128_cbc },
-       { "aes192-cbc",         SSH_CIPHER_SSH2, 16, 24, EVP_aes_192_cbc },
-       { "aes256-cbc",         SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
+       { "aes128-cbc",         SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc },
+       { "aes192-cbc",         SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc },
+       { "aes256-cbc",         SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
        { "rijndael-cbc@lysator.liu.se",
-                               SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
+                               SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
 #endif
 #if OPENSSL_VERSION_NUMBER >= 0x00905000L
-       { "aes128-ctr",         SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr },
-       { "aes192-ctr",         SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr },
-       { "aes256-ctr",         SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr },
+       { "aes128-ctr",         SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr },
+       { "aes192-ctr",         SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr },
+       { "aes256-ctr",         SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr },
 #endif
 #if defined(EVP_CTRL_SET_ACSS_MODE)
-       { "acss@openssh.org",   SSH_CIPHER_SSH2, 16, 5, EVP_acss },
+       { "acss@openssh.org",   SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss },
 #endif
-       { NULL,                 SSH_CIPHER_INVALID, 0, 0, NULL }
+       { NULL,                 SSH_CIPHER_INVALID, 0, 0, 0, NULL }
 };
 
 /*--*/
@@ -224,6 +227,7 @@ cipher_init(CipherContext *cc, Cipher *cipher,
        const EVP_CIPHER *type;
 #endif
        int klen;
+       u_char *junk, *discard;
 
        if (cipher->number == SSH_CIPHER_DES) {
                if (dowarn) {
@@ -271,6 +275,17 @@ cipher_init(CipherContext *cc, Cipher *cipher,
                fatal("cipher_init: EVP_CipherInit: set key failed for %s",
                    cipher->name);
 #endif
+
+       if (cipher->discard_len > 0) {          
+               junk = xmalloc(cipher->discard_len);
+               discard = xmalloc(cipher->discard_len);
+               if (EVP_Cipher(&cc->evp, discard, junk,
+                   cipher->discard_len) == 0)
+                       fatal("evp_crypt: EVP_Cipher failed during discard");
+               memset(discard, 0, cipher->discard_len);
+               xfree(junk);
+               xfree(discard);
+       }
 }
 
 void
index 228ed68828da36fe4c5809f5ea54cbff31cd76c6..2edbe1624838aaafc4fccb0eb1fad53a3ab3041e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: myproposal.h,v 1.16 2004/06/13 12:53:24 djm Exp $     */
+/*     $OpenBSD: myproposal.h,v 1.17 2005/05/23 23:32:46 djm Exp $     */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -28,7 +28,8 @@
        "diffie-hellman-group1-sha1"
 #define        KEX_DEFAULT_PK_ALG      "ssh-rsa,ssh-dss"
 #define        KEX_DEFAULT_ENCRYPT \
-       "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \
+       "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
+       "arcfour128,arcfour256,arcfour," \
        "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
        "aes128-ctr,aes192-ctr,aes256-ctr"
 #define        KEX_DEFAULT_MAC \
diff --git a/ssh.1 b/ssh.1
index 05d2234a3e23bb09ab31300ecce1c14c9fddccf0..4cc1738c13a0fc4d58e455c16f630e287f42e5dc 100644 (file)
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: ssh.1,v 1.207 2005/04/21 06:17:50 djm Exp $
+.\" $OpenBSD: ssh.1,v 1.208 2005/05/23 23:32:46 djm Exp $
 .Dd September 25, 1999
 .Dt SSH 1
 .Os
@@ -479,14 +479,17 @@ The supported ciphers are
 .Dq aes128-ctr ,
 .Dq aes192-ctr ,
 .Dq aes256-ctr ,
+.Dq arcfour128 ,
+.Dq arcfour256 ,
 .Dq arcfour ,
 .Dq blowfish-cbc ,
 and
 .Dq cast128-cbc .
 The default is
 .Bd -literal
-  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
-    aes192-cbc,aes256-cbc''
+  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
+    arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
+    aes192-ctr,aes256-ctr''
 .Ed
 .It Fl D Ar port
 Specifies a local
index 42eefa034227797722dee2d4cd873c84999b4f55..18899ae58defa3e7f41f68611ab174f3e1462f0e 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: ssh_config.5,v 1.53 2005/05/20 11:23:32 jmc Exp $
+.\" $OpenBSD: ssh_config.5,v 1.54 2005/05/23 23:32:46 djm Exp $
 .Dd September 25, 1999
 .Dt SSH_CONFIG 5
 .Os
@@ -193,14 +193,17 @@ The supported ciphers are
 .Dq aes128-ctr ,
 .Dq aes192-ctr ,
 .Dq aes256-ctr ,
+.Dq arcfour128 ,
+.Dq arcfour256 ,
 .Dq arcfour ,
 .Dq blowfish-cbc ,
 and
 .Dq cast128-cbc .
 The default is
 .Bd -literal
-  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
-    aes192-cbc,aes256-cbc''
+  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
+    arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
+    aes192-ctr,aes256-ctr''
 .Ed
 .It Cm ClearAllForwardings
 Specifies that all local, remote and dynamic port forwardings
index 70d18ab0f4820d074a14326987e1867fa2228ca8..cec2a2382bddea7c046b9f97965d27992f1801f5 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: sshd_config.5,v 1.42 2005/05/19 02:39:55 djm Exp $
+.\" $OpenBSD: sshd_config.5,v 1.43 2005/05/23 23:32:46 djm Exp $
 .Dd September 25, 1999
 .Dt SSHD_CONFIG 5
 .Os
@@ -168,14 +168,17 @@ The supported ciphers are
 .Dq aes128-ctr ,
 .Dq aes192-ctr ,
 .Dq aes256-ctr ,
+.Dq arcfour128 ,
+.Dq arcfour256 ,
 .Dq arcfour ,
 .Dq blowfish-cbc ,
 and
 .Dq cast128-cbc .
 The default is
 .Bd -literal
-  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
-    aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr''
+  ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
+    arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
+    aes192-ctr,aes256-ctr''
 .Ed
 .It Cm ClientAliveCountMax
 Sets the number of client alive messages (see above) which may be
This page took 0.064096 seconds and 5 git commands to generate.