From 5f408f940707f3bd2c2a2d887c484795436a5639 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 13 Sep 1995 21:05:01 +0000 Subject: [PATCH] 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6778 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 10 ++++++++++ src/lib/kdb/decrypt_key.c | 4 +--- src/lib/kdb/fetch_mkey.c | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index dfe27fd23..9fbccffbc 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,13 @@ +Wed Sep 13 15:19:17 1995 Theodore Y. Ts'o + + * 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 * decrypt_key.c (krb5_dbekd_decrypt_key_data): Set the encryption diff --git a/src/lib/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index e7128c9dc..4f67d519e 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -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; diff --git a/src/lib/kdb/fetch_mkey.c b/src/lib/kdb/fetch_mkey.c index 9f8d533c1..1f2c5e227 100644 --- a/src/lib/kdb/fetch_mkey.c +++ b/src/lib/kdb/fetch_mkey.c @@ -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; -- 2.26.2