|
Lines 28-33
Link Here
|
| 28 |
#include <openssl/bn.h> |
28 |
#include <openssl/bn.h> |
| 29 |
#include <openssl/dh.h> |
29 |
#include <openssl/dh.h> |
| 30 |
|
30 |
|
|
|
31 |
#include <errno.h> |
| 31 |
#include <stdio.h> |
32 |
#include <stdio.h> |
| 32 |
#include <stdlib.h> |
33 |
#include <stdlib.h> |
| 33 |
#include <string.h> |
34 |
#include <string.h> |
|
Lines 148-157
choose_dh(int min, int wantbits, int max
Link Here
|
| 148 |
int linenum; |
149 |
int linenum; |
| 149 |
struct dhgroup dhg; |
150 |
struct dhgroup dhg; |
| 150 |
|
151 |
|
| 151 |
if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL && |
152 |
if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL) { |
| 152 |
(f = fopen(_PATH_DH_PRIMES, "r")) == NULL) { |
153 |
logit("WARNING: could open open %s (%s), using fixed modulus", |
| 153 |
logit("WARNING: %s does not exist, using fixed modulus", |
154 |
_PATH_DH_MODULI, strerror(errno)); |
| 154 |
_PATH_DH_MODULI); |
|
|
| 155 |
return (dh_new_group_fallback(max)); |
155 |
return (dh_new_group_fallback(max)); |
| 156 |
} |
156 |
} |
| 157 |
|
157 |
|
|
Lines 179-185
choose_dh(int min, int wantbits, int max
Link Here
|
| 179 |
|
179 |
|
| 180 |
if (bestcount == 0) { |
180 |
if (bestcount == 0) { |
| 181 |
fclose(f); |
181 |
fclose(f); |
| 182 |
logit("WARNING: no suitable primes in %s", _PATH_DH_PRIMES); |
182 |
logit("WARNING: no suitable primes in %s", _PATH_DH_MODULI); |
| 183 |
return (dh_new_group_fallback(max)); |
183 |
return (dh_new_group_fallback(max)); |
| 184 |
} |
184 |
} |
| 185 |
|
185 |
|
|
Lines 200-206
choose_dh(int min, int wantbits, int max
Link Here
|
| 200 |
fclose(f); |
200 |
fclose(f); |
| 201 |
if (linenum != which+1) { |
201 |
if (linenum != which+1) { |
| 202 |
logit("WARNING: line %d disappeared in %s, giving up", |
202 |
logit("WARNING: line %d disappeared in %s, giving up", |
| 203 |
which, _PATH_DH_PRIMES); |
203 |
which, _PATH_DH_MODULI); |
| 204 |
return (dh_new_group_fallback(max)); |
204 |
return (dh_new_group_fallback(max)); |
| 205 |
} |
205 |
} |
| 206 |
|
206 |
|