Reworked EAP-TLS 1.3 to account for RFC9190, implemented searching by certificate instead of certificate CN

This commit is contained in:
Evengard committed 2023-01-31 20:33:18 +03:00
1 parent 26403c70e3
commit edcdc923ad
14 files changed
+197 -146

No files matched your search

+9 -6
View File
@@ -897,21 +897,24 @@ USER *AcGetUser(HUB *h, char *name)
return u;
}
USER* AcGetUserByCert(HUB *h, char *common_name)
USER* AcGetUserByCert(HUB *h, X *cert)
{
int i;
if (cert == NULL)
{
return NULL;
}
for (i = 0; i < LIST_NUM(h->HubDb->UserList); i++)
{
USER* u = LIST_DATA(h->HubDb->UserList, i);
if (u->AuthType == AUTHTYPE_USERCERT)
{
X* cert = ((AUTHUSERCERT*)u->AuthData)->UserX;
if (cert != NULL)
X* ucert = ((AUTHUSERCERT*)u->AuthData)->UserX;
if (ucert != NULL)
{
char cname[MAX_SIZE];
UniToStr(cname, sizeof(cname), cert->subject_name->CommonName);
if (StrCmp(common_name, cname) == 0)
if (CompareX(cert, ucert))
{
AddRef(u->ref);
return u;