version 1.129, 2005/09/13 23:40:07 |
version 1.130, 2005/10/07 11:13:57 |
|
|
#endif |
#endif |
#include "dns.h" |
#include "dns.h" |
|
|
/* Number of bits in the RSA/DSA key. This value can be changed on the command line. */ |
/* Number of bits in the RSA/DSA key. This value can be set on the command line. */ |
u_int32_t bits = 2048; |
#define DEFAULT_BITS 2048 |
|
#define DEFAULT_BITS_DSA 1024 |
|
u_int32_t bits = 0; |
|
|
/* |
/* |
* Flag indicating that we just want to change the passphrase. This can be |
* Flag indicating that we just want to change the passphrase. This can be |
|
|
out_file, strerror(errno)); |
out_file, strerror(errno)); |
return (1); |
return (1); |
} |
} |
|
if (bits == 0) |
|
bits = DEFAULT_BITS; |
if (gen_candidates(out, memory, bits, start) != 0) |
if (gen_candidates(out, memory, bits, start) != 0) |
fatal("modulus candidate generation failed\n"); |
fatal("modulus candidate generation failed\n"); |
|
|
|
|
} |
} |
if (!quiet) |
if (!quiet) |
printf("Generating public/private %s key pair.\n", key_type_name); |
printf("Generating public/private %s key pair.\n", key_type_name); |
|
if (bits == 0) |
|
bits = (type == KEY_DSA) ? DEFAULT_BITS_DSA : DEFAULT_BITS; |
private = key_generate(type, bits); |
private = key_generate(type, bits); |
if (private == NULL) { |
if (private == NULL) { |
fprintf(stderr, "key_generate failed"); |
fprintf(stderr, "key_generate failed"); |