]> andersk Git - openssh.git/blobdiff - kex.c
- jmc@cvs.openbsd.org 2005/03/01 18:15:56
[openssh.git] / kex.c
diff --git a/kex.c b/kex.c
index 30dd58a78e362d0502fc391560a2cd14b766357a..a668346c393411efac7a27978ff029e4a194bb83 100644 (file)
--- a/kex.c
+++ b/kex.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: kex.c,v 1.57 2004/05/09 01:19:27 djm Exp $");
+RCSID("$OpenBSD: kex.c,v 1.60 2004/06/21 17:36:31 avsm Exp $");
 
 #include <openssl/crypto.h>
 
@@ -148,7 +148,7 @@ kex_finish(Kex *kex)
 void
 kex_send_kexinit(Kex *kex)
 {
-       u_int32_t rand = 0;
+       u_int32_t rnd = 0;
        u_char *cookie;
        int i;
 
@@ -168,9 +168,9 @@ kex_send_kexinit(Kex *kex)
        cookie = buffer_ptr(&kex->my);
        for (i = 0; i < KEX_COOKIE_LEN; i++) {
                if (i % 4 == 0)
-                       rand = arc4random();
-               cookie[i] = rand;
-               rand >>= 8;
+                       rnd = arc4random();
+               cookie[i] = rnd;
+               rnd >>= 8;
        }
        packet_start(SSH2_MSG_KEXINIT);
        packet_put_raw(buffer_ptr(&kex->my), buffer_len(&kex->my));
@@ -293,6 +293,8 @@ choose_kex(Kex *k, char *client, char *server)
                fatal("no kex alg");
        if (strcmp(k->name, KEX_DH1) == 0) {
                k->kex_type = KEX_DH_GRP1_SHA1;
+       } else if (strcmp(k->name, KEX_DH14) == 0) {
+               k->kex_type = KEX_DH_GRP14_SHA1;
        } else if (strcmp(k->name, KEX_DHGEX) == 0) {
                k->kex_type = KEX_DH_GEX_SHA1;
        } else
@@ -504,7 +506,7 @@ derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,
 
        EVP_DigestUpdate(&md, cookie, 8);
 
-       EVP_DigestFinal(&md, id, NULL);
+       EVP_DigestFinal(&md, obuf, NULL);
        memcpy(id, obuf, 16);
 
        memset(nbuf, 0, sizeof(nbuf));
This page took 0.623616 seconds and 4 git commands to generate.