Skip to content

Commit

Permalink
Put KDB authdata first
Browse files Browse the repository at this point in the history
Windows services, as well as some versions of Samba, may refuse
tickets if the PAC is not in the first AD-IF-RELEVANT container.  In
fetch_kdb_authdata(), change the merge order so that authdata from the
KDB module appears first.

[ghudson@mit.edu: added comment and clarified commit message]

(cherry picked from commit 331fa4b)

ticket: 8872
version_fixed: 1.17.2
  • Loading branch information
iboukris authored and greghudson committed Feb 10, 2020
1 parent 45ec4ac commit 813ef2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/kdc/kdc_authdata.c
Expand Up @@ -383,11 +383,14 @@ fetch_kdb_authdata(krb5_context context, unsigned int flags,
if (ret)
return (ret == KRB5_PLUGIN_OP_NOTSUPP) ? 0 : ret;

/* Add the KDB authdata to the ticket, without copying or filtering. */
ret = merge_authdata(context, db_authdata,
&enc_tkt_reply->authorization_data, FALSE, FALSE);
/* Put the KDB authdata first in the ticket. A successful merge places the
* combined list in db_authdata and releases the old ticket authdata. */
ret = merge_authdata(context, enc_tkt_reply->authorization_data,
&db_authdata, FALSE, FALSE);
if (ret)
krb5_free_authdata(context, db_authdata);
else
enc_tkt_reply->authorization_data = db_authdata;
return ret;
}

Expand Down

0 comments on commit 813ef2b

Please sign in to comment.