version 1.58, 2016/02/28 22:27:00 |
version 1.59, 2016/03/31 05:24:06 |
|
|
#include <openssl/bn.h> |
#include <openssl/bn.h> |
#include <openssl/dh.h> |
#include <openssl/dh.h> |
|
|
|
#include <errno.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
int linenum; |
int linenum; |
struct dhgroup dhg; |
struct dhgroup dhg; |
|
|
if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL && |
if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL) { |
(f = fopen(_PATH_DH_PRIMES, "r")) == NULL) { |
logit("WARNING: could open open %s (%s), using fixed modulus", |
logit("WARNING: %s does not exist, using fixed modulus", |
_PATH_DH_MODULI, strerror(errno)); |
_PATH_DH_MODULI); |
|
return (dh_new_group_fallback(max)); |
return (dh_new_group_fallback(max)); |
} |
} |
|
|
|
|
|
|
if (bestcount == 0) { |
if (bestcount == 0) { |
fclose(f); |
fclose(f); |
logit("WARNING: no suitable primes in %s", _PATH_DH_PRIMES); |
logit("WARNING: no suitable primes in %s", _PATH_DH_MODULI); |
return (dh_new_group_fallback(max)); |
return (dh_new_group_fallback(max)); |
} |
} |
|
|
|
|
fclose(f); |
fclose(f); |
if (linenum != which+1) { |
if (linenum != which+1) { |
logit("WARNING: line %d disappeared in %s, giving up", |
logit("WARNING: line %d disappeared in %s, giving up", |
which, _PATH_DH_PRIMES); |
which, _PATH_DH_MODULI); |
return (dh_new_group_fallback(max)); |
return (dh_new_group_fallback(max)); |
} |
} |
|
|