diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-05-01 01:06:57 +0200 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-05-01 01:06:57 +0200 |
commit | 8c9639225559fab155828a3396cdbdc7fcb5cad0 (patch) | |
tree | a550c0644b049e2e24715ff8763779373055507b /kex.c | |
parent | - (tim) [contrib/caldera/openssh.spec] add Requires line for Caldera 3.1 (diff) | |
download | openssh-8c9639225559fab155828a3396cdbdc7fcb5cad0.tar.xz openssh-8c9639225559fab155828a3396cdbdc7fcb5cad0.zip |
- markus@cvs.openbsd.org 2001/04/30 15:50:46
[compat.c compat.h kex.c]
allow interop with weaker key generation used by ssh-2.0.x, x < 10
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kex.c,v 1.33 2001/04/05 10:42:50 markus Exp $"); +RCSID("$OpenBSD: kex.c,v 1.34 2001/04/30 15:50:46 markus Exp $"); #include <openssl/crypto.h> @@ -375,7 +375,8 @@ derive_key(Kex *kex, int id, int need, u_char *hash, BIGNUM *shared_secret) /* K1 = HASH(K || H || "A" || session_id) */ EVP_DigestInit(&md, evp_md); - EVP_DigestUpdate(&md, buffer_ptr(&b), buffer_len(&b)); + if (!(datafellows & SSH_BUG_DERIVEKEY)) + EVP_DigestUpdate(&md, buffer_ptr(&b), buffer_len(&b)); EVP_DigestUpdate(&md, hash, mdsz); EVP_DigestUpdate(&md, &c, 1); EVP_DigestUpdate(&md, kex->session_id, kex->session_id_len); @@ -388,7 +389,8 @@ derive_key(Kex *kex, int id, int need, u_char *hash, BIGNUM *shared_secret) */ for (have = mdsz; need > have; have += mdsz) { EVP_DigestInit(&md, evp_md); - EVP_DigestUpdate(&md, buffer_ptr(&b), buffer_len(&b)); + if (!(datafellows & SSH_BUG_DERIVEKEY)) + EVP_DigestUpdate(&md, buffer_ptr(&b), buffer_len(&b)); EVP_DigestUpdate(&md, hash, mdsz); EVP_DigestUpdate(&md, digest, have); EVP_DigestFinal(&md, digest + have, NULL); |