Remove the -K/-J options for setting keys.

The options were never really used and do not seem especially useful;
initialization with a seed file still works.

This also fixes a bug with the initialization of the siphash key.
This commit is contained in:
Johanna Amann 2016-07-13 16:40:47 -07:00
parent 313647ce0e
commit 499ed5b566
6 changed files with 19 additions and 26 deletions

View file

@ -190,8 +190,6 @@ void usage()
fprintf(stderr, " -G|--load-seeds <file> | load seeds from given file\n");
fprintf(stderr, " -H|--save-seeds <file> | save seeds to given file\n");
fprintf(stderr, " -I|--print-id <ID name> | print out given ID\n");
fprintf(stderr, " -J|--set-seed <seed> | set the random number seed\n");
fprintf(stderr, " -K|--md5-hashkey <hashkey> | set key for MD5-keyed hashing\n");
fprintf(stderr, " -N|--print-plugins | print available plugins and exit (-NN for verbose)\n");
fprintf(stderr, " -P|--prime-dns | prime DNS\n");
fprintf(stderr, " -Q|--time | print execution time summary to stderr\n");
@ -459,7 +457,6 @@ int main(int argc, char** argv)
char* debug_streams = 0;
int parse_only = false;
int bare_mode = false;
int seed = 0;
int dump_cfg = false;
int to_xml = 0;
int do_watchdog = 0;
@ -491,8 +488,6 @@ int main(int argc, char** argv)
{"force-dns", no_argument, 0, 'F'},
{"load-seeds", required_argument, 0, 'G'},
{"save-seeds", required_argument, 0, 'H'},
{"set-seed", required_argument, 0, 'J'},
{"md5-hashkey", required_argument, 0, 'K'},
{"print-plugins", no_argument, 0, 'N'},
{"prime-dns", no_argument, 0, 'P'},
{"time", no_argument, 0, 'Q'},
@ -546,7 +541,7 @@ int main(int argc, char** argv)
opterr = 0;
char opts[256];
safe_strncpy(opts, "B:e:f:G:H:I:i:J:K:n:p:R:r:s:T:t:U:w:x:X:z:CFNPQSWabdghv",
safe_strncpy(opts, "B:e:f:G:H:I:i:n:p:R:r:s:T:t:U:w:x:X:z:CFNPQSWabdghv",
sizeof(opts));
#ifdef USE_PERFTOOLS_DEBUG
@ -661,15 +656,6 @@ int main(int argc, char** argv)
id_name = optarg;
break;
case 'J':
seed = atoi(optarg);
break;
case 'K':
MD5((const u_char*) optarg, strlen(optarg), shared_hmac_md5_key);
hmac_key_set = true;
break;
case 'N':
++print_plugins;
break;
@ -760,7 +746,7 @@ int main(int argc, char** argv)
}
#endif
init_random_seed(seed, (seed_load_file && *seed_load_file ? seed_load_file : 0) , seed_save_file);
init_random_seed((seed_load_file && *seed_load_file ? seed_load_file : 0) , seed_save_file);
// DEBUG_MSG("HMAC key: %s\n", md5_digest_print(shared_hmac_md5_key));
init_hash_function();