mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-25 01:29:53 +03:00
Merge pull request #313 from zulzardi/patch-2
Fixed RSA key bits wrong calculation for certain x509 certificate
This commit is contained in:
commit
f9436daa6f
@ -4096,14 +4096,22 @@ X *X509ToX(X509 *x509)
|
||||
type = k->pkey->type;
|
||||
|
||||
FreeBuf(b);
|
||||
|
||||
|
||||
//Fixed to get actual RSA key bits
|
||||
x->bits = EVP_PKEY_bits(k->pkey);
|
||||
|
||||
FreeK(k);
|
||||
|
||||
if (type == EVP_PKEY_RSA)
|
||||
{
|
||||
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:
|
||||
x->bits = 1024;
|
||||
@ -4128,7 +4136,7 @@ X *X509ToX(X509 *x509)
|
||||
default:
|
||||
x->is_compatible_bit = false;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return x;
|
||||
|
Loading…
Reference in New Issue
Block a user