From a28191f07ec46862dc8798237cce9176ecaa07e7 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Tue, 5 Mar 1996 07:29:29 +0000 Subject: [PATCH] now the keys actually *work* when you load an old dump (a real one, 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 | 7 +++++++ src/admin/edit/dump.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index 24fba1771..82f7d55fd 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,10 @@ +Mon Feb 26 22:13:45 1996 Mark Eichin + + * 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 * dump.c (process_k5beta_record): encrypted keys used to have 4 diff --git a/src/admin/edit/dump.c b/src/admin/edit/dump.c index 2dd3aec0b..405074c88 100644 --- a/src/admin/edit/dump.c +++ b/src/admin/edit/dump.c @@ -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)) || -- 2.26.2