------------------------------------------------------------------------
r22434 | tlyu | 2009-07-10 15:20:26 -0400 (Fri, 10 Jul 2009) | 8 lines
ticket: 1233
Add a new '-W' option to kadmind and kdb5_util create to allow reading
weak random numbers on startup, to avoid long delays in testing
situations. Use only for testing.
Update testing scripts accordingly.
ticket: 1233
version_fixed: 1.7.1
status: resolved
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22803
dc483132-0cff-0310-8789-
dd5450dbe970
krb5_data pwd, seed;
kdb_log_context *log_ctx;
krb5_kvno mkey_kvno;
+ int strong_random = 1;
- while ((optchar = getopt(argc, argv, "s")) != -1) {
+ while ((optchar = getopt(argc, argv, "sW")) != -1) {
switch(optchar) {
case 's':
do_stash++;
exit(1);
}
break;
+ case 'W':
+ strong_random = 0;
+ break;
case '?':
default:
usage();
log_ctx = util_context->kdblog_context;
printf ("Loading random data\n");
- retval = krb5_c_random_os_entropy (util_context, 1, NULL);
+ retval = krb5_c_random_os_entropy (util_context, strong_random, NULL);
if (retval) {
com_err (progname, retval, "Loading random data");
exit_status++; return;
int db_args_size = 0;
char *errmsg;
int i;
+ int strong_random = 1;
kdb_log_context *log_ctx;
usage();
params.kadmind_port = atoi(*argv);
params.mask |= KADM5_CONFIG_KADMIND_PORT;
+ } else if (strcmp(*argv, "-W") == 0) {
+ strong_random = 0;
} else
break;
argc--; argv++;
}
krb5_klog_syslog(LOG_INFO, "Seeding random number generator");
- ret = krb5_c_random_os_entropy(context, 1, NULL);
+ ret = krb5_c_random_os_entropy(context, strong_random, NULL);
if (ret) {
krb5_klog_syslog(LOG_ERR, "Error getting random seed: %s, aborting",
krb5_get_error_message(context, ret));
sofar_s=0
timewait_s=300
+ovadm_args=-W
+
while true; do
rm -f $adm_start_file
}
#exec xterm
verbose "starting $test"
- spawn $KDB5_UTIL -r $REALMNAME create
+ spawn $KDB5_UTIL -r $REALMNAME create -W
expect_after $def_exp_after
expect "Enter KDC database master key:"
# removed when this is fixed
envstack_push
setup_kerberos_env kdc
- spawn $BINSH -c "exec $KADMIND -r $REALMNAME -nofork 2>>$kadmind_lfile"
+ spawn $BINSH -c "exec $KADMIND -r $REALMNAME -W -nofork 2>>$kadmind_lfile"
envstack_pop
set kadmind_pid [exp_pid]
set kadmind_spawn_id $spawn_id