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

Execute.SChannel not safe init SSLAvailable #11

Open
delphicz opened this issue Jan 22, 2024 · 0 comments
Open

Execute.SChannel not safe init SSLAvailable #11

delphicz opened this issue Jan 22, 2024 · 0 comments

Comments

@delphicz
Copy link

delphicz commented Jan 22, 2024

function SSLAvailable: Boolean; is not thread safe, because Initialized is set early and when second thread check SSLAvailable too quick, SSPI is not set, but Initialized is set.

So second thread crash with AV on SSPI.something ( in my case in SSPI.AcquireCredentialsHandle).

Maybe can be solve dirty with
function SSLAvailable: Boolean; var init: function: PSecurityFunctionTable; stdcall; begin Result := Initialized; SSPError := 0; if not Initialized or (SSPI = nil) then {SSPI = nil can be when SSL is inicializing in threads and SSPI is not assigned yet} begin {$IFDEF LOG}WriteLn('SSLAvailable');{$ENDIF} Initialized := True;

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

No branches or pull requests

1 participant