From fa7e04c804fd9b716b72e51398926b0f9fafc72f Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Wed, 30 Oct 2002 20:10:40 +0000 Subject: [PATCH] ticket: 1230 owner: tlyu status: open Ignore trailing nulls on incoming tr encoding to be compatible with bug in previous versions of krb5 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14946 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/chk_trans.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 4376c9d9a..61704d206 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +2002-10-30 Sam Hartman + + * chk_trans.c: Ignore trailing null in transited encoding; older + versions of MIT code included this. + 2002-10-28 Ken Raeburn * get_in_tkt.c (conf_yes, conf_no): Now const. References diff --git a/src/lib/krb5/krb/chk_trans.c b/src/lib/krb5/krb/chk_trans.c index 4a38bf6f7..2c7e92f13 100644 --- a/src/lib/krb5/krb/chk_trans.c +++ b/src/lib/krb5/krb/chk_trans.c @@ -315,17 +315,23 @@ check_realm_in_list (krb5_data *realm, void *data) } krb5_error_code -krb5_check_transited_list (krb5_context ctx, const krb5_data *trans, +krb5_check_transited_list (krb5_context ctx, const krb5_data *trans_in, const krb5_data *crealm, const krb5_data *srealm) { + krb5_data trans; struct check_data cdata; krb5_error_code r; + trans.length = trans_in->length; + trans.data = (char *) trans_in->data; + if (trans.length&&( trans.data[trans.length-1] == NULL)) + trans.length--; + Tprintf (("krb5_check_transited_list(trans=\"%.*s\", crealm=\"%.*s\", srealm=\"%.*s\")\n", - (int) trans->length, trans->data, + (int) translength, trans.data, (int) crealm->length, crealm->data, (int) srealm->length, srealm->data)); - if (trans->length == 0) + if (trans.length == 0) return 0; r = krb5_walk_realm_tree (ctx, crealm, srealm, &cdata.tgs, KRB5_REALM_BRANCH_CHAR); @@ -347,7 +353,7 @@ krb5_check_transited_list (krb5_context ctx, const krb5_data *trans, } #endif cdata.ctx = ctx; - r = foreach_realm (check_realm_in_list, &cdata, crealm, srealm, trans); + r = foreach_realm (check_realm_in_list, &cdata, crealm, srealm, &trans); krb5_free_realm_tree (ctx, cdata.tgs); return r; } -- 2.26.2