version 1.2, 2000/10/11 20:11:35 |
version 1.2.4.2, 2001/03/12 15:44:10 |
|
|
#include <openssl/dh.h> |
#include <openssl/dh.h> |
#include <openssl/evp.h> |
#include <openssl/evp.h> |
|
|
#include "ssh.h" |
|
#include "buffer.h" |
#include "buffer.h" |
|
#include "cipher.h" |
#include "kex.h" |
#include "kex.h" |
#include "dh.h" |
#include "dh.h" |
|
#include "pathnames.h" |
|
#include "log.h" |
|
#include "misc.h" |
|
|
int |
int |
parse_prime(int linenum, char *line, struct dhgroup *dhg) |
parse_prime(int linenum, char *line, struct dhgroup *dhg) |
|
|
|
|
return (1); |
return (1); |
fail: |
fail: |
fprintf(stderr, "Bad prime description in line %d\n", linenum); |
error("Bad prime description in line %d\n", linenum); |
return (0); |
return (0); |
} |
} |
|
|
|
|
int linenum; |
int linenum; |
struct dhgroup dhg; |
struct dhgroup dhg; |
|
|
f = fopen(DH_PRIMES, "r"); |
f = fopen(_PATH_DH_PRIMES, "r"); |
if (!f) { |
if (!f) { |
perror(DH_PRIMES); |
log("WARNING: %s does not exist, using old prime", _PATH_DH_PRIMES); |
log("WARNING: %s does not exist, using old prime", DH_PRIMES); |
|
return (dh_new_group1()); |
return (dh_new_group1()); |
} |
} |
|
|
|
|
fclose (f); |
fclose (f); |
|
|
if (bestcount == 0) { |
if (bestcount == 0) { |
log("WARNING: no primes in %s, using old prime", DH_PRIMES); |
log("WARNING: no primes in %s, using old prime", _PATH_DH_PRIMES); |
return (dh_new_group1()); |
return (dh_new_group1()); |
} |
} |
|
|
f = fopen(DH_PRIMES, "r"); |
f = fopen(_PATH_DH_PRIMES, "r"); |
if (!f) { |
if (!f) { |
perror(DH_PRIMES); |
fatal("WARNING: %s dissappeared, giving up", _PATH_DH_PRIMES); |
exit(1); |
|
} |
} |
|
|
linenum = 0; |
linenum = 0; |