From 0d05762aff4e33080b75f21894ce66e93c331f5f Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 13 Jun 2003 22:30:59 +0000 Subject: [PATCH] * server_kdb.c (kdb_init_hist): Force history principal's key to be of the same enctype as the master key, as searches for it later on explicitly specify the enctype. ticket: 964 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15621 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/srv/ChangeLog | 6 ++++++ src/lib/kadm5/srv/server_kdb.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/lib/kadm5/srv/ChangeLog b/src/lib/kadm5/srv/ChangeLog index 334d063cd..5c53f6011 100644 --- a/src/lib/kadm5/srv/ChangeLog +++ b/src/lib/kadm5/srv/ChangeLog @@ -1,3 +1,9 @@ +2003-06-13 Tom Yu + + * server_kdb.c (kdb_init_hist): Force history principal's key to + be of the same enctype as the master key, as searches for it later + on explicitly specify the enctype. + 2003-04-01 Tom Yu * Makefile.in: Remove $(SHLIB_DBLIB_DEPS) and related variables. diff --git a/src/lib/kadm5/srv/server_kdb.c b/src/lib/kadm5/srv/server_kdb.c index 231fcb3ef..97d38c7b6 100644 --- a/src/lib/kadm5/srv/server_kdb.c +++ b/src/lib/kadm5/srv/server_kdb.c @@ -107,6 +107,7 @@ krb5_error_code kdb_init_hist(kadm5_server_handle_t handle, char *r) int ret = 0; char *realm, *hist_name; krb5_key_data *key_data; + krb5_key_salt_tuple ks[1]; if (r == NULL) { if ((ret = krb5_get_default_realm(handle->context, &realm))) @@ -144,11 +145,13 @@ krb5_error_code kdb_init_hist(kadm5_server_handle_t handle, char *r) history principal, anyway. */ hist_kvno = 2; - - ret = kadm5_create_principal(handle, &ent, - (KADM5_PRINCIPAL | KADM5_MAX_LIFE | - KADM5_ATTRIBUTES), - "to-be-random"); + ks[0].ks_enctype = handle->params.enctype; + ks[0].ks_salttype = KRB5_KDB_SALTTYPE_NORMAL; + ret = kadm5_create_principal_3(handle, &ent, + (KADM5_PRINCIPAL | KADM5_MAX_LIFE | + KADM5_ATTRIBUTES), + 1, ks, + "to-be-random"); if (ret) goto done; @@ -156,7 +159,8 @@ krb5_error_code kdb_init_hist(kadm5_server_handle_t handle, char *r) hist_princ = NULL; - ret = kadm5_randkey_principal(handle, ent.principal, NULL, NULL); + ret = kadm5_randkey_principal_3(handle, ent.principal, 0, 1, ks, + NULL, NULL); hist_princ = ent.principal; -- 2.26.2