diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-11-14 21:36:45 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-11-14 21:36:45 +0800 |
commit | a65f84db38eebcde867ab4bfc5b916f61e95bfa2 (patch) | |
tree | d5c32671e64204b67b96dcbf2d9d2b828c11b7b9 /common-kex.c | |
parent | 8c8ecec3e96525d498077da81084302371bab4da (diff) | |
download | dropbear-a65f84db38eebcde867ab4bfc5b916f61e95bfa2.tar.gz |
- Some fixes for old compilers like tru64 v4 from Daniel Richard G.
- Don't warn about blocking random device for prngd
Diffstat (limited to 'common-kex.c')
-rw-r--r-- | common-kex.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common-kex.c b/common-kex.c index a304d02..2af6253 100644 --- a/common-kex.c +++ b/common-kex.c @@ -286,7 +286,7 @@ static void hashkeys(unsigned char *out, unsigned int outlen, const struct ltc_hash_descriptor *hash_desc = ses.newkeys->algo_kex->hash_desc; hash_state hs2; unsigned int offset; - unsigned char tmpout[hash_desc->hashsize]; + unsigned char tmpout[MAX_HASH_SIZE]; memcpy(&hs2, hs, sizeof(hash_state)); hash_desc->process(&hs2, &X, 1); @@ -303,6 +303,7 @@ static void hashkeys(unsigned char *out, unsigned int outlen, hash_desc->done(&hs2, tmpout); memcpy(&out[offset], tmpout, MIN(outlen - offset, hash_desc->hashsize)); } + } /* Generate the actual encryption/integrity keys, using the results of the @@ -569,6 +570,7 @@ static void load_dh_p(mp_int * dh_p) * See the transport rfc 4253 section 8 for details */ /* dh_pub and dh_priv MUST be already initialised */ struct kex_dh_param *gen_kexdh_param() { + struct kex_dh_param *param = NULL; DEF_MP_INT(dh_p); DEF_MP_INT(dh_q); @@ -576,7 +578,7 @@ struct kex_dh_param *gen_kexdh_param() { TRACE(("enter gen_kexdh_vals")) - struct kex_dh_param *param = m_malloc(sizeof(*param)); + param = m_malloc(sizeof(*param)); m_mp_init_multi(¶m->pub, ¶m->priv, &dh_g, &dh_p, &dh_q, NULL); /* read the prime and generator*/ @@ -823,16 +825,16 @@ static void read_kex_algos() { int allgood = 1; /* we AND this with each goodguess and see if its still true after */ - buf_incrpos(ses.payload, 16); /* start after the cookie */ - - memset(ses.newkeys, 0x0, sizeof(*ses.newkeys)); - #ifdef USE_KEXGUESS2 enum kexguess2_used kexguess2 = KEXGUESS2_LOOK; #else enum kexguess2_used kexguess2 = KEXGUESS2_NO; #endif + buf_incrpos(ses.payload, 16); /* start after the cookie */ + + memset(ses.newkeys, 0x0, sizeof(*ses.newkeys)); + /* kex_algorithms */ algo = buf_match_algo(ses.payload, sshkex, &kexguess2, &goodguess); allgood &= goodguess; |