* kadm_funcs.c: changed all references of des-cbc-md5 to des-cbc-crc
authorRichard Basch <probe@mit.edu>
Wed, 20 Mar 1996 01:02:32 +0000 (01:02 +0000)
committerRichard Basch <probe@mit.edu>
Wed, 20 Mar 1996 01:02:32 +0000 (01:02 +0000)
(which is what v4 really uses); also, fixed uninitialized variable.

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

src/kadmin.v4/server/ChangeLog
src/kadmin.v4/server/kadm_funcs.c

index db29ecc9515b1e1abe2f5e931a96bc9c0d2360c8..4b57bbcba464089d0d76bb22f8c81eb0ba679fd8 100644 (file)
@@ -1,3 +1,8 @@
+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
+       (which is what v4 really uses); also, fixed uninitialized variable.
+
 Wed Feb 21 23:34:31 1996  Richard Basch  <basch@lehman.com>
 
        * kadm_funcs.c: Initialize the length element of the krb5_db_entry
index 5e228e4b17cee82ec87a09e43e34e8c7586b55d6..34cbc1f77c7a22dc5c6fd9540ced0515da8c3d46 100644 (file)
@@ -78,7 +78,7 @@ kadm_entry2princ(entry, princ)
   /* Find the V4 key */
   retval = krb5_dbe_find_enctype(kadm_context,
                                 &entry,
-                                ENCTYPE_DES_CBC_MD5,
+                                ENCTYPE_DES_CBC_CRC,
                                 KRB5_KDB_SALTTYPE_V4,
                                 -1,
                                 &pkey);
@@ -128,7 +128,7 @@ kadm_princ2entry(princ, entry)
 
   if (retval = krb5_dbe_find_enctype(kadm_context,
                                     entry,
-                                    ENCTYPE_DES_CBC_MD5,
+                                    ENCTYPE_DES_CBC_CRC,
                                     KRB5_KDB_SALTTYPE_V4,
                                     -1,
                                     &kdatap)) {
@@ -136,7 +136,7 @@ kadm_princ2entry(princ, entry)
       kdatap = &entry->key_data[entry->n_key_data-1];
   }
   if (kdatap) {
-    kdatap->key_data_type[0] = (krb5_int16) ENCTYPE_DES_CBC_MD5;
+    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;
   }
@@ -243,7 +243,7 @@ Kadm_vals *valsout;
 
   if (retval = krb5_dbe_find_enctype(kadm_context,
                                     &newentry,
-                                    ENCTYPE_DES_CBC_MD5,
+                                    ENCTYPE_DES_CBC_CRC,
                                     KRB5_KDB_SALTTYPE_V4,
                                     -1,
                                     &pkey)) {
@@ -258,7 +258,7 @@ Kadm_vals *valsout;
   memcpy(newpw.contents, &data_i.key_low, 4);
   memcpy((char *)(((krb5_int32 *) newpw.contents) + 1), &data_i.key_high, 4);
   newpw.length = 8;
-  newpw.enctype = ENCTYPE_DES_CBC_MD5;
+  newpw.enctype = ENCTYPE_DES_CBC_CRC;
   sblock.type = KRB5_KDB_SALTTYPE_V4;
   sblock.data.length = 0;
   sblock.data.data = (char *) NULL;
@@ -515,8 +515,9 @@ Kadm_vals *valsout;         /* the actual record which is returned */
 
   syslog(LOG_INFO, "request to modify '%s.%s's entry from '%s.%s@%s' ",
             valsin1->name, valsin1->instance, rname, rinstance, rrealm);
-  krb5_425_conv_principal(kadm_context, valsin1->name, valsin1->instance,
-                         server_parm.krbrlm, &theprinc);
+  retval = krb5_425_conv_principal(kadm_context,
+                                  valsin1->name, valsin1->instance,
+                                  server_parm.krbrlm, &theprinc);
   if (retval)
     failmod(retval);
   numfound = 1;
@@ -543,14 +544,14 @@ Kadm_vals *valsout;               /* the actual record which is returned */
       }
       newpw.magic = KV5M_KEYBLOCK;
       newpw.length = 8;
-      newpw.enctype = ENCTYPE_DES_CBC_MD5;
+      newpw.enctype = ENCTYPE_DES_CBC_CRC;
       temp_key.key_low = ntohl(temp_key.key_low);
       temp_key.key_high = ntohl(temp_key.key_high);
       memcpy(newpw.contents, &temp_key.key_low, 4);
       memcpy(newpw.contents + 4, &temp_key.key_high, 4);
       if (retval = krb5_dbe_find_enctype(kadm_context,
                                         &newentry,
-                                        ENCTYPE_DES_CBC_MD5,
+                                        ENCTYPE_DES_CBC_CRC,
                                         KRB5_KDB_SALTTYPE_V4,
                                         -1,
                                         &pkey)) {
@@ -673,7 +674,7 @@ des_cblock newpw;
     failchange(KADM_NOMEM);
   memcpy(localpw.contents, newpw, 8);
   localpw.magic = KV5M_KEYBLOCK;
-  localpw.enctype = ENCTYPE_DES_CBC_MD5;
+  localpw.enctype = ENCTYPE_DES_CBC_CRC;
   localpw.length = 8;
   numfound = 1;
   retval = krb5_db_get_principal(kadm_context, rprinc, &odata,
@@ -686,13 +687,14 @@ des_cblock newpw;
   } else if (numfound == 1) {
     if (retval = krb5_dbe_find_enctype(kadm_context,
                                       &odata,
-                                      ENCTYPE_DES_CBC_MD5,
+                                      ENCTYPE_DES_CBC_CRC,
                                       KRB5_KDB_SALTTYPE_V4,
                                       -1,
                                       &pkey)) {
       failchange(retval);
     }
     pkey->key_data_kvno++;
+    pkey->key_data_kvno %= 256;
     numfound = 1;
     sblock.type = KRB5_KDB_SALTTYPE_V4;
     sblock.data.length = 0;
@@ -967,7 +969,7 @@ kadm_chg_srvtab(rname, rinstance, rrealm, values)
   } else if (numfound) {
     retval = krb5_dbe_find_enctype(kadm_context,
                                   &odata,
-                                  ENCTYPE_DES_CBC_MD5,
+                                  ENCTYPE_DES_CBC_CRC,
                                   KRB5_KDB_SALTTYPE_V4,
                                   -1,
                                   &pkey);
@@ -991,7 +993,7 @@ kadm_chg_srvtab(rname, rinstance, rrealm, values)
       pkey = &odata.key_data[0];
       memset(pkey, 0, sizeof(*pkey));
       pkey->key_data_ver = 2;
-      pkey->key_data_type[0] = ENCTYPE_DES_CBC_MD5;
+      pkey->key_data_type[0] = ENCTYPE_DES_CBC_CRC;
       pkey->key_data_type[1] = KRB5_KDB_SALTTYPE_V4;
     }
   }
@@ -1011,7 +1013,7 @@ kadm_chg_srvtab(rname, rinstance, rrealm, values)
     krb5_db_free_principal(kadm_context, &odata, 1);
     failsrvtab(KADM_NOMEM);
   }
-  newpw.enctype = ENCTYPE_DES_CBC_MD5;
+  newpw.enctype = ENCTYPE_DES_CBC_CRC;
   newpw.length = 8;
   memcpy((char *)newpw.contents, new_key, 8);
   memset((char *)new_key, 0, sizeof (new_key));