mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Update Encrypt.c
Fixed RSA bits wrong calculation for certain x509 certificate
This commit is contained in:
parent
4df2eb4f9c
commit
a3db7b2e3d
@ -4011,14 +4011,22 @@ X *X509ToX(X509 *x509)
|
|||||||
type = k->pkey->type;
|
type = k->pkey->type;
|
||||||
|
|
||||||
FreeBuf(b);
|
FreeBuf(b);
|
||||||
|
|
||||||
|
//Fixed to get actual RSA key bits
|
||||||
|
x->bits = EVP_PKEY_bits(k->pkey);
|
||||||
|
|
||||||
FreeK(k);
|
FreeK(k);
|
||||||
|
|
||||||
if (type == EVP_PKEY_RSA)
|
if (type == EVP_PKEY_RSA)
|
||||||
{
|
{
|
||||||
x->is_compatible_bit = true;
|
x->is_compatible_bit = true;
|
||||||
|
|
||||||
switch (size)
|
if(x->bits != 1024 && x->bits != 1536 && x->bits != 2048 && x->bits != 3072 && x->bits != 4096)
|
||||||
|
x->is_compatible_bit = false;
|
||||||
|
else
|
||||||
|
x->is_compatible_bit = true;
|
||||||
|
|
||||||
|
/*switch (size)
|
||||||
{
|
{
|
||||||
case 162:
|
case 162:
|
||||||
x->bits = 1024;
|
x->bits = 1024;
|
||||||
@ -4043,7 +4051,7 @@ X *X509ToX(X509 *x509)
|
|||||||
default:
|
default:
|
||||||
x->is_compatible_bit = false;
|
x->is_compatible_bit = false;
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
Loading…
Reference in New Issue
Block a user