Fix crealm tgt/tgs rep when decoding #45
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When decoding tgt/tgs from native format in to_tgt() and to_tgs() the realm of the server is passed as the
crealm
instead of the user's realm. But as mentioned in Windows specs:This was an issue when having to get referral ticket from multiple domains, e.g user
TREE2.LAB\Jane
wants to access toldap/dc1.outsider.lab
and there is a forest trust betweenBLOODY.CORP
andOUTSIDER.LAB
andTREE2.LAB
is a tree belonging to theBLOODY.CORP
forest, here is what happens:At the end we have a
KRB_AP_ERR_BADMATCH "The ticket and authenticator do not match"
because the server realm of the ticket provided as a crealm for the authenticator is BLOODY.CORP but the real user realm is TREE2.LAB which is the value for the crealm in the encrypted part of the ticket so there is a mismatch between the authenticator and ticket and so the server reject our request.The PR change that by assigning the user realm instead of the server realm to the tgt/tgs rep when decoding the ticket from native to python.