upstream commit

relax bits needed check to allow
 diffie-hellman-group1-sha1 key exchange to complete for chacha20-poly1305 was
 selected as symmetric cipher; ok markus
This commit is contained in:
djm@openbsd.org 2015-03-26 06:59:28 +00:00 committed by Damien Miller
parent 47842f71e3
commit b8afbe2c1a
1 changed files with 2 additions and 2 deletions

4
dh.c
View File

@ -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. * 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 || if (need < 0 || dh->p == NULL ||
(pbits = BN_num_bits(dh->p)) <= 0 || (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; return SSH_ERR_INVALID_ARGUMENT;
dh->length = MIN(need * 2, pbits - 1); dh->length = MIN(need * 2, pbits - 1);
if (DH_generate_key(dh) == 0 || if (DH_generate_key(dh) == 0 ||