According to MS-SFU 3.2.5.1.1, the KDC should issue a referral for
S4U2Self requests if the requesting service is not in the KDC's realm.
Commit
8a9909ff9ef6b51c5ed09ead6713888fbb34072f explicitly prevents
referrals for S4U2Self requests; on further analysis, this appears to
have been preserving a bug rather than applying a proper constraint.
However, we should not issue referrals for within-realm S4U2Self
requests. (This should only come up if a server possesses a TGT but
its principal entry has been deleted.)
Remove the S4U2Self referral check in process_tgs_req(). Instead add
a more specific check in kdc_process_s4u2self_req(), adding new
parameters for the header server principal and a flag indicating
whether a referral is indicated.
[ghudson@mit.edu: rewrote commit message; adjusted style slightly]
ticket: 8747 (new)
errcode = kdc_process_s4u2self_req(kdc_active_realm,
request,
header_enc_tkt->client,
+ header_ticket->server,
+ is_referral,
server,
subkey,
header_enc_tkt->session,
if (errcode)
goto cleanup;
- if (s4u_x509_user != NULL) {
+ if (s4u_x509_user != NULL)
setflag(c_flags, KRB5_KDB_FLAG_PROTOCOL_TRANSITION);
- if (is_referral) {
- /* The requesting server appears to no longer exist, and we found
- * a referral instead. Treat this as a server lookup failure. */
- errcode = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
- status = "LOOKING_UP_SERVER";
- goto cleanup;
- }
- }
/* Deal with user-to-user and constrained delegation */
errcode = decrypt_2ndtkt(kdc_active_realm, request, c_flags,
kdc_process_s4u2self_req(kdc_realm_t *kdc_active_realm,
krb5_kdc_req *request,
krb5_const_principal client_princ,
+ krb5_const_principal header_srv_princ,
+ krb5_boolean issuing_referral,
const krb5_db_entry *server,
krb5_keyblock *tgs_subkey,
krb5_keyblock *tgs_session,
const char **status)
{
krb5_error_code code;
+ krb5_boolean is_local_tgt;
krb5_pa_data *pa_data;
int flags;
krb5_db_entry *princ;
return KRB5KDC_ERR_BADOPTION;
}
+ is_local_tgt = !is_cross_tgs_principal(header_srv_princ);
+ if (is_local_tgt && issuing_referral) {
+ /* The requesting server appears to no longer exist, and we found
+ * a referral instead. Treat this as a server lookup failure. */
+ *status = "LOOKING_UP_SERVER";
+ return KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
+ }
+
/*
* Do not attempt to lookup principals in foreign realms.
*/
kdc_process_s4u2self_req (kdc_realm_t *kdc_active_realm,
krb5_kdc_req *request,
krb5_const_principal client_princ,
+ krb5_const_principal header_srv_princ,
+ krb5_boolean issuing_referral,
const krb5_db_entry *server,
krb5_keyblock *tgs_subkey,
krb5_keyblock *tgs_session,