summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/dh.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/dh.c')
-rw-r--r--crypto/openssh/dh.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/openssh/dh.c b/crypto/openssh/dh.c
index b9029d8..d943ca1 100644
--- a/crypto/openssh/dh.c
+++ b/crypto/openssh/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.48 2009/10/01 11:37:33 grunk Exp $ */
+/* $OpenBSD: dh.c,v 1.49 2011/12/07 05:44:38 djm Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
*
@@ -236,6 +236,8 @@ dh_gen_key(DH *dh, int need)
{
int i, bits_set, tries = 0;
+ if (need < 0)
+ fatal("dh_gen_key: need < 0");
if (dh->p == NULL)
fatal("dh_gen_key: dh->p == NULL");
if (need > INT_MAX / 2 || 2 * need >= BN_num_bits(dh->p))
OpenPOWER on IntegriCloud