new principals were being created with two keys, one of which the
authorRichard Basch <probe@mit.edu>
Fri, 22 Mar 1996 04:50:48 +0000 (04:50 +0000)
committerRichard Basch <probe@mit.edu>
Fri, 22 Mar 1996 04:50:48 +0000 (04:50 +0000)
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
src/kadmin.v4/server/kadm_funcs.c

index 4b57bbcba464089d0d76bb22f8c81eb0ba679fd8..da08fdfad6e71db6f4cda9233ce5a5b4e7e7a3ba 100644 (file)
@@ -1,3 +1,8 @@
+Thu Mar 21 20:33:43 1996  Richard Basch  <basch@lehman.com>
+
+       * 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  <basch@lehman.com>
 
        * kadm_funcs.c: changed all references of des-cbc-md5 to des-cbc-crc
index 34cbc1f77c7a22dc5c6fd9540ced0515da8c3d46..5025e3acb2a01b6c612fc0463a9fc54c2ebfa0e9 100644 (file)
@@ -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);