summaryrefslogtreecommitdiff
path: root/dh.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2016-09-12 01:22:38 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-09-12 13:46:29 +1000
commit9136ec134c97a8aff2917760c03134f52945ff3c (patch)
treebfcab357e6e0f510d9b63bac43b18097e89fa58a /dh.c
parentf219fc8f03caca7ac82a38ed74bbd6432a1195e7 (diff)
upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitions rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
Diffstat (limited to 'dh.c')
-rw-r--r--dh.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dh.c b/dh.c
index 167d3714e..194f29b15 100644
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.c,v 1.60 2016/05/02 10:26:04 djm Exp $ */ 1/* $OpenBSD: dh.c,v 1.61 2016/09/12 01:22:38 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * 4 *
@@ -25,7 +25,6 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#include <sys/param.h> /* MIN */
29 28
30#include <openssl/bn.h> 29#include <openssl/bn.h>
31#include <openssl/dh.h> 30#include <openssl/dh.h>
@@ -272,7 +271,7 @@ dh_gen_key(DH *dh, int need)
272 * Pollard Rho, Big step/Little Step attacks are O(sqrt(n)), 271 * Pollard Rho, Big step/Little Step attacks are O(sqrt(n)),
273 * so double requested need here. 272 * so double requested need here.
274 */ 273 */
275 dh->length = MIN(need * 2, pbits - 1); 274 dh->length = MINIMUM(need * 2, pbits - 1);
276 if (DH_generate_key(dh) == 0 || 275 if (DH_generate_key(dh) == 0 ||
277 !dh_pub_is_valid(dh, dh->pub_key)) { 276 !dh_pub_is_valid(dh, dh->pub_key)) {
278 BN_clear_free(dh->priv_key); 277 BN_clear_free(dh->priv_key);