Fix SChannel pointer mismatches and SCRAM fallback#270
Open
jjj333-p wants to merge 1 commit into
Open
Conversation
* Fix `tls_schannel.c` passing `tls_t*` instead of `struct conn_interface*` * Prevent "Memory allocation error" in `auth.c` by gracefully falling back * Query if tls backend supports channel binding before indicating support
Author
|
forgot to run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Heya, this is related to when I ~4 days ago asked in the profanity chat about a memory error in the tls library on windows. I really needed this working for a project, so I decided to try to fix it myself. This makes it work for me, I'm not an experienced c dev so its possible I've committed great sins lol.
The memory error was
tls_schannel.cpassingtls_t*instead ofstruct conn_interface*. I'm pretty confident of this fix.However fixing the pointer type brought me to another issue, where I was getting a "Memory allocation error" which came from
auth.cthrowing an error when the tls backend error-ed on the current authentication method rather than trying the next method. This seems to be caused by the schannel backend not supporting channel binding, however I'm not exactly sure if that is fixable (by me), so instead I fixed the falling back.Once falling back was fixed, prosody would throw an error because we indicate channel binding support if tls is enabled, rather than checking if the backend supports it. I simply added a check to see if the tls backend has channel binding, and using that to advertise support or not.