mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 00:04:57 +03:00
Merge PR #1235: Manage security level
This commit is contained in:
@ -67,13 +67,26 @@ void CheckNetworkListenThread(THREAD *thread, void *param)
|
||||
{
|
||||
CHECK_NETWORK_1 *c = (CHECK_NETWORK_1 *)param;
|
||||
SOCK *s;
|
||||
UINT i;
|
||||
UINT i, rsa_bits = 1024;
|
||||
K *pub, *pri;
|
||||
X *x;
|
||||
LIST *o = NewList(NULL);
|
||||
NAME *name = NewName(L"Test", L"Test", L"Test", L"JP", L"Ibaraki", L"Tsukuba");
|
||||
|
||||
RsaGen(&pri, &pub, 1024);
|
||||
// Set RSA bits considering OpenSSL security Level
|
||||
// Security level 4 needs 7680 bits
|
||||
switch (GetOSSecurityLevel())
|
||||
{
|
||||
case 2:
|
||||
rsa_bits = 2048;
|
||||
break;
|
||||
case 3:
|
||||
rsa_bits = 4096;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
RsaGen(&pri, &pub, rsa_bits);
|
||||
x = NewRootX(pub, pri, name, 1000, NULL);
|
||||
|
||||
FreeName(name);
|
||||
|
@ -5931,6 +5931,8 @@ void SiLoadServerCfg(SERVER *s, FOLDER *f)
|
||||
c->SslAcceptSettings.Tls_Disable1_1 = CfgGetBool(f, "Tls_Disable1_1");
|
||||
c->SslAcceptSettings.Tls_Disable1_2 = CfgGetBool(f, "Tls_Disable1_2");
|
||||
c->SslAcceptSettings.Tls_Disable1_3 = CfgGetBool(f, "Tls_Disable1_3");
|
||||
c->SslAcceptSettings.Override_Security_Level = CfgGetBool(f, "Override_Security_Level");
|
||||
c->SslAcceptSettings.Override_Security_Level_Value = CfgGetInt(f, "Override_Security_Level_Value");
|
||||
|
||||
s->StrictSyslogDatetimeFormat = CfgGetBool(f, "StrictSyslogDatetimeFormat");
|
||||
|
||||
@ -6256,6 +6258,8 @@ void SiWriteServerCfg(FOLDER *f, SERVER *s)
|
||||
CfgAddBool(f, "Tls_Disable1_1", c->SslAcceptSettings.Tls_Disable1_1);
|
||||
CfgAddBool(f, "Tls_Disable1_2", c->SslAcceptSettings.Tls_Disable1_2);
|
||||
CfgAddBool(f, "Tls_Disable1_3", c->SslAcceptSettings.Tls_Disable1_3);
|
||||
CfgAddBool(f, "Override_Security_Level", c->SslAcceptSettings.Override_Security_Level);
|
||||
CfgAddInt(f, "Override_Security_Level_Value", c->SslAcceptSettings.Override_Security_Level_Value);
|
||||
CfgAddInt(f, "DhParamBits", c->DhParamBits);
|
||||
|
||||
// Disable session reconnect
|
||||
|
Reference in New Issue
Block a user