diff options
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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.62 2016/12/15 21:20:41 dtucker 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> |
@@ -153,7 +152,7 @@ choose_dh(int min, int wantbits, int max) | |||
153 | struct dhgroup dhg; | 152 | struct dhgroup dhg; |
154 | 153 | ||
155 | if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL) { | 154 | if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL) { |
156 | logit("WARNING: could open open %s (%s), using fixed modulus", | 155 | logit("WARNING: could not open %s (%s), using fixed modulus", |
157 | _PATH_DH_MODULI, strerror(errno)); | 156 | _PATH_DH_MODULI, strerror(errno)); |
158 | return (dh_new_group_fallback(max)); | 157 | return (dh_new_group_fallback(max)); |
159 | } | 158 | } |
@@ -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); |