1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-10 01:34:58 +03:00

Support user-specified server trust chain

This commit is contained in:
domosekai
2021-07-21 07:02:42 +00:00
parent 1f40de2dda
commit 2761c1ca42
19 changed files with 437 additions and 16 deletions

View File

@ -1157,6 +1157,10 @@ void CleanupCedar(CEDAR *c)
{
FreeK(c->ServerK);
}
if (c->ServerChain)
{
FreeXList(c->ServerChain);
}
if (c->CipherList)
{
@ -1386,6 +1390,10 @@ void FreeNetSvcList(CEDAR *cedar)
// Change certificate of Cedar
void SetCedarCert(CEDAR *c, X *server_x, K *server_k)
{
SetCedarCertAndChain(c, server_x, server_k, NULL);
}
void SetCedarCertAndChain(CEDAR *c, X *server_x, K *server_k, LIST *server_chain)
{
// Validate arguments
if (server_x == NULL || server_k == NULL)
@ -1405,8 +1413,14 @@ void SetCedarCert(CEDAR *c, X *server_x, K *server_k)
FreeK(c->ServerK);
}
if (c->ServerChain != NULL)
{
FreeXList(c->ServerChain);
}
c->ServerX = CloneX(server_x);
c->ServerK = CloneK(server_k);
c->ServerChain = CloneXList(server_chain);
}
Unlock(c->lock);
}