svn rev #22803: branches/krb5-1-7/src/ kadmin/dbutil/ kadmin/server/ kadmin/testing/scripts/ ...
tlyu@MIT.EDU
tlyu at MIT.EDU
Mon Sep 28 17:22:48 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22803
Commit By: tlyu
Log Message:
ticket: 1233
version_fixed: 1.7.1
status: resolved
pull up r22434 from trunk
------------------------------------------------------------------------
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.
Changed Files:
U branches/krb5-1-7/src/kadmin/dbutil/kdb5_create.c
U branches/krb5-1-7/src/kadmin/server/ovsec_kadmd.c
U branches/krb5-1-7/src/kadmin/testing/scripts/start_servers_local
U branches/krb5-1-7/src/tests/dejagnu/config/default.exp
Modified: branches/krb5-1-7/src/kadmin/dbutil/kdb5_create.c
===================================================================
--- branches/krb5-1-7/src/kadmin/dbutil/kdb5_create.c 2009-09-28 21:22:43 UTC (rev 22802)
+++ branches/krb5-1-7/src/kadmin/dbutil/kdb5_create.c 2009-09-28 21:22:47 UTC (rev 22803)
@@ -167,8 +167,9 @@
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++;
@@ -179,6 +180,9 @@
exit(1);
}
break;
+ case 'W':
+ strong_random = 0;
+ break;
case '?':
default:
usage();
@@ -196,7 +200,7 @@
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;
Modified: branches/krb5-1-7/src/kadmin/server/ovsec_kadmd.c
===================================================================
--- branches/krb5-1-7/src/kadmin/server/ovsec_kadmd.c 2009-09-28 21:22:43 UTC (rev 22802)
+++ branches/krb5-1-7/src/kadmin/server/ovsec_kadmd.c 2009-09-28 21:22:47 UTC (rev 22803)
@@ -222,6 +222,7 @@
int db_args_size = 0;
char *errmsg;
int i;
+ int strong_random = 1;
kdb_log_context *log_ctx;
@@ -292,6 +293,8 @@
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++;
@@ -490,7 +493,7 @@
}
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));
Modified: branches/krb5-1-7/src/kadmin/testing/scripts/start_servers_local
===================================================================
--- branches/krb5-1-7/src/kadmin/testing/scripts/start_servers_local 2009-09-28 21:22:43 UTC (rev 22802)
+++ branches/krb5-1-7/src/kadmin/testing/scripts/start_servers_local 2009-09-28 21:22:47 UTC (rev 22803)
@@ -137,6 +137,8 @@
sofar_s=0
timewait_s=300
+ovadm_args=-W
+
while true; do
rm -f $adm_start_file
Modified: branches/krb5-1-7/src/tests/dejagnu/config/default.exp
===================================================================
--- branches/krb5-1-7/src/tests/dejagnu/config/default.exp 2009-09-28 21:22:43 UTC (rev 22802)
+++ branches/krb5-1-7/src/tests/dejagnu/config/default.exp 2009-09-28 21:22:47 UTC (rev 22803)
@@ -1272,7 +1272,7 @@
}
#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:"
@@ -1823,7 +1823,7 @@
# 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
More information about the cvs-krb5
mailing list