From 90e157f35f1400e4a97f375f23fb43f765f30c49 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 26 Jan 1996 05:20:17 +0000 Subject: [PATCH] Fixed to check enctype of retrieved keys git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7388 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ChangeLog | 4 ++++ src/lib/krb5/keytab/file/ktf_g_ent.c | 8 ++++++-- src/lib/krb5/keytab/file/ktfile.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index c3648e3ef..006f194b4 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,7 @@ +Thu Jan 25 15:52:34 1996 Sam Hartman + + * ktf_g_ent.c (krb5_ktfile_get_entry): Match against enctype. + Fri Jan 5 04:50:41 1996 Ezra Peisach (epeisach@kangaroo.mit.edu) * ser_ktf.c (krb5_ktf_keytab_internalize): Take care of gcc diff --git a/src/lib/krb5/keytab/file/ktf_g_ent.c b/src/lib/krb5/keytab/file/ktf_g_ent.c index f6c72fe98..e0688336e 100644 --- a/src/lib/krb5/keytab/file/ktf_g_ent.c +++ b/src/lib/krb5/keytab/file/ktf_g_ent.c @@ -56,14 +56,18 @@ krb5_ktfile_get_entry(context, id, principal, kvno, enctype, entry) if ((kerror = krb5_ktfileint_read_entry(context, id, &new_entry))) break; - if (krb5_principal_compare(context, principal, new_entry.principal)) { + if (((enctype == IGNORE_ENCTYPE)|| + (new_entry.key.enctype == enctype))&& + krb5_principal_compare(context, principal, new_entry.principal)) { if (kvno == IGNORE_VNO) { if (cur_entry.vno < new_entry.vno) { - krb5_kt_free_entry(context, &cur_entry); + krb5_kt_free_entry(context, &cur_entry); cur_entry = new_entry; } } else { if (new_entry.vno == kvno) { +krb5_kt_free_entry(context, &cur_entry); + cur_entry = new_entry; break; } diff --git a/src/lib/krb5/keytab/file/ktfile.h b/src/lib/krb5/keytab/file/ktfile.h index 846596608..0b2542ceb 100644 --- a/src/lib/krb5/keytab/file/ktfile.h +++ b/src/lib/krb5/keytab/file/ktfile.h @@ -35,6 +35,7 @@ * Constants */ #define IGNORE_VNO 0 +#define IGNORE_ENCTYPE 0 #define KRB5_KT_VNO_1 0x0501 /* krb v5, keytab version 1 (DCE compat) */ #define KRB5_KT_VNO 0x0502 /* krb v5, keytab version 2 (standard) */ -- 2.26.2