From 1471da60b27d54d4492e2cd7af48bd9c9b8f3c4e Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Fri, 22 Mar 1996 04:50:48 +0000 Subject: [PATCH] new principals were being created with two keys, one of which the key_data_ver=0 and had no valid data git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7699 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin.v4/server/ChangeLog | 5 +++++ src/kadmin.v4/server/kadm_funcs.c | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/kadmin.v4/server/ChangeLog b/src/kadmin.v4/server/ChangeLog index 4b57bbcba..da08fdfad 100644 --- a/src/kadmin.v4/server/ChangeLog +++ b/src/kadmin.v4/server/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 21 20:33:43 1996 Richard Basch + + * kadm_funcs.c: new principals were being created with two keys, + one of which the key_data_ver=0 and had no valid data. + Tue Mar 19 19:42:37 1996 Richard Basch * kadm_funcs.c: changed all references of des-cbc-md5 to des-cbc-crc diff --git a/src/kadmin.v4/server/kadm_funcs.c b/src/kadmin.v4/server/kadm_funcs.c index 34cbc1f77..5025e3acb 100644 --- a/src/kadmin.v4/server/kadm_funcs.c +++ b/src/kadmin.v4/server/kadm_funcs.c @@ -136,6 +136,7 @@ kadm_princ2entry(princ, entry) kdatap = &entry->key_data[entry->n_key_data-1]; } if (kdatap) { + kdatap->key_data_ver = 2; kdatap->key_data_type[0] = (krb5_int16) ENCTYPE_DES_CBC_CRC; kdatap->key_data_type[1] = (krb5_int16) KRB5_KDB_SALTTYPE_V4; kdatap->key_data_kvno = (krb5_int16) princ.key_version; @@ -241,15 +242,12 @@ Kadm_vals *valsout; if ((newpw.contents = (krb5_octet *)malloc(8)) == NULL) failadd(KADM_NOMEM); - if (retval = krb5_dbe_find_enctype(kadm_context, - &newentry, - ENCTYPE_DES_CBC_CRC, - KRB5_KDB_SALTTYPE_V4, - -1, - &pkey)) { - if (!(retval = krb5_dbe_create_key_data(kadm_context, &newentry))) - pkey = &newentry.key_data[newentry.n_key_data-1]; - } + retval = krb5_dbe_find_enctype(kadm_context, + &newentry, + ENCTYPE_DES_CBC_CRC, + KRB5_KDB_SALTTYPE_V4, + -1, + &pkey); if (retval) failadd(retval); -- 2.26.2