Fixed to check enctype of retrieved keys
authorSam Hartman <hartmans@mit.edu>
Fri, 26 Jan 1996 05:20:17 +0000 (05:20 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 26 Jan 1996 05:20:17 +0000 (05:20 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7388 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/file/ChangeLog
src/lib/krb5/keytab/file/ktf_g_ent.c
src/lib/krb5/keytab/file/ktfile.h

index c3648e3ef09d02e5513c5eb0146fdcec24b629ff..006f194b4173b8de9479ca761fc7f224d9a523d7 100644 (file)
@@ -1,3 +1,7 @@
+Thu Jan 25 15:52:34 1996  Sam Hartman  <hartmans@tertius.mit.edu>
+
+       * 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
index f6c72fe98b96f36ebbdbb0a21dab9943948995d1..e0688336e944b574f349c238a2e15e906448d85f 100644 (file)
@@ -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;
                        }
index 846596608794d961186a18aa864d6b00d846a26e..0b2542ceb46ce21822163b35cd82941c444cb527 100644 (file)
@@ -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)  */