fetch_mkey.c (krb5_db_fetch_mkey): This routine now sets the master
authorTheodore Tso <tytso@mit.edu>
Wed, 13 Sep 1995 21:05:01 +0000 (21:05 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 13 Sep 1995 21:05:01 +0000 (21:05 +0000)
encblock's crypto system using krb5_use_enctype() from the stored
keytype of the master key.

decrypt_key.c (krb5_dbekd_decrypt_key_data): Remove the encryption
type; the master_encblock should always be set correctly.

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

src/lib/kdb/ChangeLog
src/lib/kdb/decrypt_key.c
src/lib/kdb/fetch_mkey.c

index dfe27fd23807f3c3abb8478a2ac7932f023add9f..9fbccffbc8c2f89fb2627c59c9398a77c28735b7 100644 (file)
@@ -1,3 +1,13 @@
+Wed Sep 13 15:19:17 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * fetch_mkey.c (krb5_db_fetch_mkey): This routine now sets the
+               master encblock's crypto system using krb5_use_enctype()
+               from the stored keytype of the master key.
+
+       * decrypt_key.c (krb5_dbekd_decrypt_key_data): Remove the
+               encryption type; the master_encblock should always be set
+               correctly.
+
 Sat Sep  9 14:53:39 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * decrypt_key.c (krb5_dbekd_decrypt_key_data): Set the encryption
index e7128c9dcc8b1cb884be372dcbf2b5486dca013f..4f67d519ee8193e6ca60a0ad7494ea8962b0c0d9 100644 (file)
@@ -47,8 +47,6 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt)
     keyblock->magic = KV5M_KEYBLOCK;
     keyblock->enctype = key_data->key_data_type[0];
 
-    krb5_use_enctype(context, eblock, keyblock->enctype);
-
     /* Decrypt key_data_contents */
     if ((keyblock->contents = (krb5_octet *)malloc(krb5_encrypt_size(
       key_data->key_data_length[0] - 2, eblock->crypto_entry))) == NULL)
@@ -73,7 +71,7 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt)
     if (keysalt) {
        if (key_data->key_data_ver == 2) {
            keysalt->type = key_data->key_data_type[1];
-           if (keysalt->data.length = key_data->key_data_length[1]) {
+           if ((keysalt->data.length = key_data->key_data_length[1])) {
                if (!(keysalt->data.data=(char *)malloc(keysalt->data.length))){
                    krb5_xfree(keyblock->contents);
                    keyblock->contents = 0;
index 9f8d533c18238a025bebad5c4b3063a52486f6bf..1f2c5e227504c37700d8240cafaa370e8f5e2a55 100644 (file)
@@ -141,6 +141,8 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, keyfile, salt, k
            key->contents = 0;
        } else
            retval = 0;
+       krb5_use_enctype(context, eblock, key->enctype);
+       
     errout:
        (void) fclose(kf);
        return retval;