Make krb5_dbe_def_search_enctype skip key data entries with invalid
authorGreg Hudson <ghudson@mit.edu>
Tue, 28 Sep 2010 19:09:11 +0000 (19:09 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 28 Sep 2010 19:09:11 +0000 (19:09 +0000)
enctypes instead of erroring out on them.  We had this behavior prior
to 1.8 (more by accident than by design), but it changed as a
side-effect of r23599.

ticket: 6790
target_version: 1.8.4
tags: pullup

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

src/lib/kdb/kdb_default.c

index 5ca749e6116944d601f20c28df53c6e1caefeffd..18de7c75a01dcf3076b99bf54e1294c7d156a38a 100644 (file)
@@ -91,12 +91,10 @@ krb5_dbe_def_search_enctype(kcontext, dbentp, start, ktype, stype, kvno, kdatap)
 
         /* Match this entry against the arguments. */
         if (ktype != -1) {
-            if ((ret = krb5_c_enctype_compare(kcontext, (krb5_enctype) ktype,
-                                              dbentp->key_data[i].key_data_type[0],
-                                              &similar)))
-
-                return(ret);
-            if (!similar)
+            ret = krb5_c_enctype_compare(kcontext, (krb5_enctype) ktype,
+                                         dbentp->key_data[i].key_data_type[0],
+                                         &similar);
+            if (ret != 0 || !similar)
                 continue;
         }
         if (stype >= 0 && db_stype != stype)