mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-07 00:01:49 -04:00
check if RSA key is large enough to sign a chunk of data
This commit is contained in:
parent
e7227f0ba0
commit
3176e4421f
@ -248,6 +248,13 @@ static bool build_emsa_pkcs1_signature(private_gmp_rsa_private_key_t *this,
|
|||||||
data = digestInfo;
|
data = digestInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.len > this->k - 3)
|
||||||
|
{
|
||||||
|
free(digestInfo.ptr);
|
||||||
|
DBG1("unable to sign %d bytes using a %dbit key", data.len, this->k * 8);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* build chunk to rsa-decrypt:
|
/* build chunk to rsa-decrypt:
|
||||||
* EM = 0x00 || 0x01 || PS || 0x00 || T.
|
* EM = 0x00 || 0x01 || PS || 0x00 || T.
|
||||||
* PS = 0xFF padding, with length to fill em
|
* PS = 0xFF padding, with length to fill em
|
||||||
|
Loading…
x
Reference in New Issue
Block a user