now the keys actually *work* when you load an old dump (a real one,
authorMark Eichin <eichin@mit.edu>
Tue, 5 Mar 1996 07:29:29 +0000 (07:29 +0000)
committerMark Eichin <eichin@mit.edu>
Tue, 5 Mar 1996 07:29:29 +0000 (07:29 +0000)
not the fake one the test case creates.)

* dump.c (process_k5beta_record): since V4 salt type has no data
  either, only set key_data_ver to 1 for data_type 0 with 0-length
  salt. Also, don't include alternate key if akey has all-zero type
and length in both fields.

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

src/admin/edit/ChangeLog
src/admin/edit/dump.c

index 24fba177116b877139167c662b93c2d6366c2571..82f7d55fd8a57bee5dbb7b625d723a059e6d78aa 100644 (file)
@@ -1,3 +1,10 @@
+Mon Feb 26 22:13:45 1996  Mark Eichin  <eichin@cygnus.com>
+
+       * dump.c (process_k5beta_record): since V4 salt type has no data
+       either, only set key_data_ver to 1 for data_type 0 with 0-length
+       salt. Also, don't include alternate key if akey has all-zero type
+       and length in both fields.
+
 Sat Feb 24 04:02:18 1996  Mark W. Eichin  <eichin@cygnus.com>
 
        * dump.c (process_k5beta_record): encrypted keys used to have 4
index 2dd3aec0b17cf4f8791d585b47d79f2549770a42..405074c884755bb6dc5bfaa101287fa4e96a19fe 100644 (file)
@@ -959,7 +959,7 @@ process_k5beta_record(fname, kcontext, filep, verbose, linenop)
                      &name_len, &mod_name_len, &key_len,
                      &alt_key_len, &salt_len, &alt_salt_len);
     if (nmatched == 6) {
-       pkey->key_data_length[0] = key_len;
+        pkey->key_data_length[0] = key_len;
        akey->key_data_length[0] = alt_key_len;
        pkey->key_data_length[1] = salt_len;
        akey->key_data_length[1] = alt_salt_len;
@@ -1137,15 +1137,20 @@ process_k5beta_record(fname, kcontext, filep, verbose, linenop)
                            int one = 1;
 
                            dbent.len = KRB5_KDB_V1_BASE_LENGTH;
-                           pkey->key_data_ver = (pkey->key_data_length[1]) ?
+                           pkey->key_data_ver = (pkey->key_data_type[1] || pkey->key_data_length[1]) ?
                                2 : 1;
-                           akey->key_data_ver = (akey->key_data_length[1]) ?
+                           akey->key_data_ver = (akey->key_data_type[1] || akey->key_data_length[1]) ?
                                2 : 1;
                            if ((pkey->key_data_type[0] ==
                                 akey->key_data_type[0]) &&
                                (pkey->key_data_type[1] ==
                                 akey->key_data_type[1]))
                                dbent.n_key_data--;
+                           else if ((akey->key_data_type[0] == 0)
+                                    && (akey->key_data_length[0] == 0)
+                                    && (akey->key_data_type[1] == 0)
+                                    && (akey->key_data_length[1] == 0))
+                               dbent.n_key_data--;
                            if ((kret = krb5_db_put_principal(kcontext,
                                                              &dbent,
                                                              &one)) ||