From 913a95f602144700291a29d99141b342dc15e565 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sun, 5 Apr 1998 05:21:35 +0000 Subject: [PATCH] (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 --- lib/hdb/hdb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/hdb/hdb.c b/lib/hdb/hdb.c index 0127e0ae4..a1059a076 100644 --- a/lib/hdb/hdb.c +++ b/lib/hdb/hdb.c @@ -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;