* ktutil_funcs.c (ktutil_write_srvtab): use any type of des key
authorRichard Basch <probe@mit.edu>
Wed, 20 Mar 1996 01:02:02 +0000 (01:02 +0000)
committerRichard Basch <probe@mit.edu>
Wed, 20 Mar 1996 01:02:02 +0000 (01:02 +0000)
in the keytab to create a v4 srvtab

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7669 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/ktutil/ChangeLog
src/kadmin/ktutil/ktutil_funcs.c

index 01a2505b1946c8bd8be34230cce0823094e727c4..d29e29b9a53f2c524481988b24c4277c0054b2f6 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar 19 19:41:31 1996  Richard Basch  <basch@lehman.com>
+
+       * ktutil_funcs.c (ktutil_write_srvtab): use any type of des key
+       in the keytab to create a v4 srvtab
+
 Fri Jan 26 00:06:50 1996  Sam Hartman  <hartmans@tertius.mit.edu>
 
        * ktutil.c (ktutil_list): Implement -e option to show enctypes.
index bad66bdc70ee21caaddb086dae1052e699615e43..5215fd815a9a530b5c622f9ed9865e099dbfb070 100644 (file)
@@ -319,36 +319,40 @@ krb5_error_code ktutil_write_srvtab(context, list, name)
 
     /* First do heinous stuff to prune the list. */
     for (lp = list; lp; lp = lp->next) {
-       if (lp->entry->key.enctype == ENCTYPE_DES_CBC_CRC) {/* only DES keys! */
-           for (lp1 = pruned; lp1; prev = lp1, lp1 = lp1->next) {
-               /* Hunt for the current principal in the pruned list */
-               if (krb5_principal_compare(context,
-                                          lp->entry->principal,
-                                          lp1->entry->principal))
+       if ((lp->entry->key.enctype != ENCTYPE_DES_CBC_CRC) &&
+           (lp->entry->key.enctype != ENCTYPE_DES_CBC_MD5) &&
+           (lp->entry->key.enctype != ENCTYPE_DES_CBC_MD4) &&
+           (lp->entry->key.enctype != ENCTYPE_DES_CBC_RAW))
+           continue;
+
+       for (lp1 = pruned; lp1; prev = lp1, lp1 = lp1->next) {
+           /* Hunt for the current principal in the pruned list */
+           if (krb5_principal_compare(context,
+                                      lp->entry->principal,
+                                      lp1->entry->principal))
                    break;
-           }
-           if (!lp1) {         /* need to add entry to tail of pruned list */
-               if (!pruned) {
-                   pruned = (krb5_kt_list) malloc(sizeof (*pruned));
-                   if (!pruned)
-                       return ENOMEM;
-                   memset((char *) pruned, 0, sizeof(*pruned));
-                   lp1 = pruned;
-               } else {
-                   prev->next
-                       = (krb5_kt_list) malloc(sizeof (*pruned));
-                   if (!prev->next) {
-                       retval = ENOMEM;
-                       goto free_pruned;
-                   }
-                   memset((char *) prev->next, 0, sizeof(*pruned));
-                   lp1 = prev->next;
-               }
-               lp1->entry = lp->entry;
-           } else if (lp1->entry->vno < lp->entry->vno)
-               /* Check if lp->entry is newer kvno; if so, update */
-               lp1->entry = lp->entry;
        }
+       if (!lp1) {             /* need to add entry to tail of pruned list */
+           if (!pruned) {
+               pruned = (krb5_kt_list) malloc(sizeof (*pruned));
+               if (!pruned)
+                   return ENOMEM;
+               memset((char *) pruned, 0, sizeof(*pruned));
+               lp1 = pruned;
+           } else {
+               prev->next
+                   = (krb5_kt_list) malloc(sizeof (*pruned));
+               if (!prev->next) {
+                   retval = ENOMEM;
+                   goto free_pruned;
+               }
+               memset((char *) prev->next, 0, sizeof(*pruned));
+               lp1 = prev->next;
+           }
+           lp1->entry = lp->entry;
+       } else if (lp1->entry->vno < lp->entry->vno)
+           /* Check if lp->entry is newer kvno; if so, update */
+           lp1->entry = lp->entry;
     }
     fp = fopen(name, "w");
     if (!fp) {