From 987658325eb7bd6b10882cc4cdd224499e7f7a03 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 23 Mar 2011 11:26:50 +1100 Subject: [PATCH] correctly decode MIT KDB flags Patch from Nico Williams --- lib/hdb/hdb-mitdb.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/hdb/hdb-mitdb.c b/lib/hdb/hdb-mitdb.c index ccc98da67..85bfc2a37 100644 --- a/lib/hdb/hdb-mitdb.c +++ b/lib/hdb/hdb-mitdb.c @@ -220,17 +220,17 @@ mdb_value2entry(krb5_context context, krb5_data *data, krb5_kvno kvno, hdb_entry if (u16 != KDB_V1_BASE_LENGTH) { ret = EINVAL; goto out; } /* 32: attributes */ CHECK(ret = krb5_ret_uint32(sp, &u32)); - entry->flags.postdate = !(u16 & KRB5_KDB_DISALLOW_POSTDATED); - entry->flags.forwardable = !(u16 & KRB5_KDB_DISALLOW_FORWARDABLE); - entry->flags.initial = !!(u16 & KRB5_KDB_DISALLOW_TGT_BASED); - entry->flags.renewable = !(u16 & KRB5_KDB_DISALLOW_RENEWABLE); - entry->flags.proxiable = !(u16 & KRB5_KDB_DISALLOW_PROXIABLE); + entry->flags.postdate = !(u32 & KRB5_KDB_DISALLOW_POSTDATED); + entry->flags.forwardable = !(u32 & KRB5_KDB_DISALLOW_FORWARDABLE); + entry->flags.initial = !!(u32 & KRB5_KDB_DISALLOW_TGT_BASED); + entry->flags.renewable = !(u32 & KRB5_KDB_DISALLOW_RENEWABLE); + entry->flags.proxiable = !(u32 & KRB5_KDB_DISALLOW_PROXIABLE); /* DUP_SKEY */ - entry->flags.invalid = !!(u16 & KRB5_KDB_DISALLOW_ALL_TIX); - entry->flags.require_preauth =!!(u16 & KRB5_KDB_REQUIRES_PRE_AUTH); - entry->flags.require_hwauth =!!(u16 & KRB5_KDB_REQUIRES_HW_AUTH); - entry->flags.server = !(u16 & KRB5_KDB_DISALLOW_SVR); - entry->flags.change_pw = !!(u16 & KRB5_KDB_PWCHANGE_SERVICE); + entry->flags.invalid = !!(u32 & KRB5_KDB_DISALLOW_ALL_TIX); + entry->flags.require_preauth =!!(u32 & KRB5_KDB_REQUIRES_PRE_AUTH); + entry->flags.require_hwauth =!!(u32 & KRB5_KDB_REQUIRES_HW_AUTH); + entry->flags.server = !(u32 & KRB5_KDB_DISALLOW_SVR); + entry->flags.change_pw = !!(u32 & KRB5_KDB_PWCHANGE_SERVICE); entry->flags.client = 1; /* XXX */ /* 32: max time */ -- 2.11.4.GIT