From bda2836b2ea9c37135801ce2f7d8f912029c8cb8 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Fri, 22 Mar 1996 04:53:25 +0000 Subject: [PATCH] all des enctypes are equivalent (interim checkin until I create a function to check the key equivalency of two enctypes). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7701 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ChangeLog | 4 ++++ src/lib/krb5/keytab/file/ktf_g_ent.c | 25 +++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index 006f194b4..385e254c8 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,7 @@ +Tue Mar 19 22:28:43 1996 Richard Basch + + * ktf_g_ent.c (krb5_ktfile_get_entry): all des enctypes are equivalent + Thu Jan 25 15:52:34 1996 Sam Hartman * ktf_g_ent.c (krb5_ktfile_get_entry): Match against enctype. diff --git a/src/lib/krb5/keytab/file/ktf_g_ent.c b/src/lib/krb5/keytab/file/ktf_g_ent.c index e0688336e..9a76ce4cd 100644 --- a/src/lib/krb5/keytab/file/ktf_g_ent.c +++ b/src/lib/krb5/keytab/file/ktf_g_ent.c @@ -53,11 +53,32 @@ krb5_ktfile_get_entry(context, id, principal, kvno, enctype, entry) cur_entry.vno = 0; cur_entry.key.contents = 0; while (TRUE) { + krb5_enctype entry_type; + if ((kerror = krb5_ktfileint_read_entry(context, id, &new_entry))) break; - if (((enctype == IGNORE_ENCTYPE)|| - (new_entry.key.enctype == enctype))&& + switch (enctype) { + case ENCTYPE_DES_CBC_CRC: + case ENCTYPE_DES_CBC_MD5: + case ENCTYPE_DES_CBC_MD4: + case ENCTYPE_DES_CBC_RAW: + enctype = ENCTYPE_DES_CBC_CRC; + break; + } + + entry_type = new_entry.key.enctype; + switch(entry_type) { + case ENCTYPE_DES_CBC_CRC: + case ENCTYPE_DES_CBC_MD5: + case ENCTYPE_DES_CBC_MD4: + case ENCTYPE_DES_CBC_RAW: + entry_type = ENCTYPE_DES_CBC_CRC; + break; + } + + if (((enctype == IGNORE_ENCTYPE)|| + (entry_type == enctype))&& krb5_principal_compare(context, principal, new_entry.principal)) { if (kvno == IGNORE_VNO) { if (cur_entry.vno < new_entry.vno) { -- 2.26.2