1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 00:04:57 +03:00

Set RSA bits considering OpenSSL security Level

This commit is contained in:
Takuho NAKANO
2020-05-05 21:03:17 +09:00
committed by Davide Beatrici
parent 5ca62bdd8a
commit 190672bd84
3 changed files with 38 additions and 2 deletions

View File

@ -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);