Fixes to patches that add *use-strong* parameters.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
This commit is contained in:
Nicolas Williams
2011-04-07 15:11:05 -05:00
committed by Love Hörnquist Åstrand
parent 8ada355954
commit c06d5ebfda
2 changed files with 21 additions and 11 deletions

View File

@@ -144,20 +144,26 @@ _kdc_get_preferred_key(krb5_context context,
if (krb5_enctype_valid(context, p[i]) != 0)
continue;
ret = hdb_enctype2key(context, &h->entry, p[i], key);
if (ret == 0) {
if (ret != 0)
continue;
if (enctype != NULL)
*enctype = p[i];
return 0;
}
return 0;
}
} else {
*key = NULL;
for (i = 0; i < h->entry.keys.len; i++) {
if (krb5_enctype_valid(context, h->entry.keys.val[i].key.keytype)
!= 0) {
*key = &h->entry.keys.val[i];
return 0;
}
!= 0)
continue;
ret = hdb_enctype2key(context, &h->entry,
h->entry.keys.val[i].key.keytype, key);
if (ret != 0)
continue;
if (enctype != NULL)
*enctype = (*key)->key.keytype;
return 0;
}
}