]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Thu, 26 Mar 2015 06:59:28 +0000 (06:59 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 27 Mar 2015 01:02:23 +0000 (12:02 +1100)
relax bits needed check to allow
 diffie-hellman-group1-sha1 key exchange to complete for chacha20-poly1305 was
 selected as symmetric cipher; ok markus

dh.c

diff --git a/dh.c b/dh.c
index a260240fd6d28baf0321a2da191d8d45b71fad24..1e5388d7f2b43c70990df10a2334fa0c6410b124 100644 (file)
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.55 2015/01/20 23:14:00 deraadt Exp $ */
+/* $OpenBSD: dh.c,v 1.56 2015/03/26 06:59:28 djm Exp $ */
 /*
  * Copyright (c) 2000 Niels Provos.  All rights reserved.
  *
@@ -261,7 +261,7 @@ dh_gen_key(DH *dh, int need)
 
        if (need < 0 || dh->p == NULL ||
            (pbits = BN_num_bits(dh->p)) <= 0 ||
-           need > INT_MAX / 2 || 2 * need >= pbits)
+           need > INT_MAX / 2 || 2 * need > pbits)
                return SSH_ERR_INVALID_ARGUMENT;
        dh->length = MIN(need * 2, pbits - 1);
        if (DH_generate_key(dh) == 0 ||