mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
Merge pull request #1759 from domosekai/fixtls
Fix thread safety after #1751
This commit is contained in:
commit
1062692d08
@ -3651,17 +3651,28 @@ bool PPPProcessEAPTlsResponse(PPP_SESSION *p, PPP_EAP *eap_packet, UINT eapSize)
|
|||||||
|
|
||||||
if (p->Eap_MatchUserByCert)
|
if (p->Eap_MatchUserByCert)
|
||||||
{
|
{
|
||||||
HUB* hub = GetHub(p->Cedar, p->Eap_Identity.HubName);
|
HUB *hub;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
LockHubList(p->Cedar);
|
||||||
|
{
|
||||||
|
hub = GetHub(p->Cedar, p->Eap_Identity.HubName);
|
||||||
|
}
|
||||||
|
UnlockHubList(p->Cedar);
|
||||||
|
|
||||||
if (hub != NULL)
|
if (hub != NULL)
|
||||||
{
|
{
|
||||||
USER* user = AcGetUserByCert(hub, p->Eap_TlsCtx.ClientCert.X);
|
AcLock(hub);
|
||||||
if (user != NULL)
|
|
||||||
{
|
{
|
||||||
StrCpy(p->Eap_Identity.UserName, sizeof(p->Eap_Identity.UserName), user->Name);
|
USER* user = AcGetUserByCert(hub, p->Eap_TlsCtx.ClientCert.X);
|
||||||
found = true;
|
if (user != NULL)
|
||||||
ReleaseUser(user);
|
{
|
||||||
|
StrCpy(p->Eap_Identity.UserName, sizeof(p->Eap_Identity.UserName), user->Name);
|
||||||
|
found = true;
|
||||||
|
ReleaseUser(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
AcUnlock(hub);
|
||||||
ReleaseHub(hub);
|
ReleaseHub(hub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user