Skip to content

Fix SChannel pointer mismatches and SCRAM fallback#270

Open
jjj333-p wants to merge 1 commit into
strophe:masterfrom
jjj333-p:master
Open

Fix SChannel pointer mismatches and SCRAM fallback#270
jjj333-p wants to merge 1 commit into
strophe:masterfrom
jjj333-p:master

Conversation

@jjj333-p

@jjj333-p jjj333-p commented Jun 12, 2026

Copy link
Copy Markdown

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.c passing tls_t* instead of struct 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.c throwing 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.

* 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
@jjj333-p

Copy link
Copy Markdown
Author

forgot to run make format sorry about that, the formatting test should be fixed now maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant