When asking for the strongest key, get it right

This commit is contained in:
Nicolas Williams
2013-07-27 17:29:54 -05:00
parent 1f147f0fa6
commit 1826106ff4

View File

@@ -133,7 +133,7 @@ _kdc_find_etype(krb5_context context, krb5_boolean use_strongest_session_key,
krb5_enctype enctype = ETYPE_NULL;
krb5_enctype clientbest = (krb5_enctype)ETYPE_NULL;
const krb5_enctype *p;
Key *key;
Key *key = NULL;
int i, k;
int client_offered_1des = 0;
@@ -178,6 +178,8 @@ _kdc_find_etype(krb5_context context, krb5_boolean use_strongest_session_key,
continue;
if (clientbest == (krb5_enctype)ETYPE_NULL)
clientbest = p[i];
if (key)
continue; /* already picked a key below */
/* check target princ support */
ret = hdb_enctype2key(context, &princ->entry, NULL, p[i], &key);
if (ret)