Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cross-realm S4U2Self work #305

Merged
merged 1 commit into from
Aug 13, 2015
Merged

Conversation

greghudson
Copy link
Member

When sending a S4U2Self query to a foreign realm, send an enterprise
server principal so that the foreign KDC can identify the home realm
of the server principal.

To make this work, adjust the memory management of
krb5_get_self_cred_from_kdc(). s4u_creds is now a shallow copy of
in_creds which owns no memory. A new variable eprinc owns the
enterprise form of the server principal, constructed using a new
helper function convert_to_enterprise(). Since we have to set the
server realm for KDC-REQ encoding to work, a new temporary variable
sprinc holds a shallow copy of *eprinc with the realm pointing to the
realm we are currently querying.

Based on a patch by Sumit Bose.

@tlyu
Copy link
Member

tlyu commented Aug 13, 2015

Looks reasonable. The added memory aliasing isn't great, but there is precedent in this very file within krb5_get_credentials_for_proxy(). The body of the loop in krb5_get_self_cred_from_kdc() is about 90 lines long, with variables declared at the top, and could therefore use refactoring. However, that was a preexisting condition and can probably be done separately.

When sending a S4U2Self query to a foreign realm, send an enterprise
server principal so that the foreign KDC can identify the home realm
of the server principal.

To make this work, adjust the memory management of
krb5_get_self_cred_from_kdc().  s4u_creds is now a shallow copy of
in_creds which owns no memory.  A new variable eprinc owns the
enterprise form of the server principal, constructed using a new
helper function convert_to_enterprise().  Since we have to set the
server realm for KDC-REQ encoding to work, a new temporary variable
sprinc holds a shallow copy of *eprinc with the realm pointing to the
realm we are currently querying.

Based on a patch by Sumit Bose.

ticket: 7790
@tlyu tlyu merged commit 16128e8 into krb5:master Aug 13, 2015
@greghudson greghudson deleted the xrealm_s4u2self branch August 13, 2015 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants