(hdb_next_etype2key): check etype against those listed as supported by

the principal


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4725 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-04-05 05:21:35 +00:00
parent 9799799e42
commit 913a95f602

View File

@@ -77,6 +77,15 @@ hdb_next_etype2key(krb5_context context,
{
krb5_keytype keytype;
krb5_error_code ret;
if(e->etypes) {
/* check if the etype is listed as `supported' by this principal */
int i;
for(i = 0; i < e->etypes->len; i++)
if(etype == e->etypes->val[i])
break;
if(i == e->etypes->len)
return KRB5_PROG_ETYPE_NOSUPP;
}
ret = krb5_etype_to_keytype(context, etype, &keytype);
if(ret)
return ret;