diff options
author | Colin Watson <cjwatson@debian.org> | 2012-05-17 13:04:02 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2012-05-17 13:04:02 +0100 |
commit | dd5ed53e20d218607260916a6b04d1c8c5b3d88f (patch) | |
tree | c59b4dbcc610f10700945f885adf3bddc2542c26 /dh.c | |
parent | 8241a65bf12ac53c1b7304bba7ce739aad80b8b8 (diff) | |
parent | b9bc38990c5eb5d99e28ca5af6d3491fd4a0060a (diff) |
merge 6.0p1
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.c,v 1.48 2009/10/01 11:37:33 grunk Exp $ */ | 1 | /* $OpenBSD: dh.c,v 1.49 2011/12/07 05:44:38 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Niels Provos. All rights reserved. | 3 | * Copyright (c) 2000 Niels Provos. All rights reserved. |
4 | * | 4 | * |
@@ -236,6 +236,8 @@ dh_gen_key(DH *dh, int need) | |||
236 | { | 236 | { |
237 | int i, bits_set, tries = 0; | 237 | int i, bits_set, tries = 0; |
238 | 238 | ||
239 | if (need < 0) | ||
240 | fatal("dh_gen_key: need < 0"); | ||
239 | if (dh->p == NULL) | 241 | if (dh->p == NULL) |
240 | fatal("dh_gen_key: dh->p == NULL"); | 242 | fatal("dh_gen_key: dh->p == NULL"); |
241 | if (need > INT_MAX / 2 || 2 * need >= BN_num_bits(dh->p)) | 243 | if (need > INT_MAX / 2 || 2 * need >= BN_num_bits(dh->p)) |