mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-06 15:54:57 +03:00
Set RSA bits considering OpenSSL security Level
This commit is contained in:
committed by
Davide Beatrici
parent
5ca62bdd8a
commit
190672bd84
@ -16840,6 +16840,28 @@ void FreeSSLCtx(struct ssl_ctx_st *ctx)
|
||||
SSL_CTX_free(ctx);
|
||||
}
|
||||
|
||||
// Get OS (maximum) Security Level
|
||||
UINT GetOSSecurityLevel()
|
||||
{
|
||||
UINT security_level_new = 0, security_level_set_ssl_version = 0;
|
||||
struct ssl_ctx_st *ctx = SSL_CTX_new(SSLv23_method());
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
security_level_new = SSL_CTX_get_security_level(ctx);
|
||||
#endif
|
||||
|
||||
security_level_set_ssl_version = SSL_CTX_set_ssl_version(ctx, SSLv23_server_method());
|
||||
|
||||
FreeSSLCtx(ctx);
|
||||
|
||||
if(security_level_new >= security_level_set_ssl_version)
|
||||
{
|
||||
return security_level_new;
|
||||
}
|
||||
|
||||
return security_level_set_ssl_version;
|
||||
}
|
||||
|
||||
// The number of get ip threads
|
||||
void SetGetIpThreadMaxNum(UINT num)
|
||||
{
|
||||
|
@ -1448,6 +1448,7 @@ void RefreshLocalMacAddressList();
|
||||
|
||||
struct ssl_ctx_st *NewSSLCtx(bool server_mode);
|
||||
void FreeSSLCtx(struct ssl_ctx_st *ctx);
|
||||
UINT GetOSSecurityLevel();
|
||||
|
||||
void SetCurrentDDnsFqdn(char *name);
|
||||
void GetCurrentDDnsFqdn(char *name, UINT size);
|
||||
|
Reference in New Issue
Block a user