FusionAuth/fusionauth-jwt

2047 vs. 2048

paul-eeoc opened this issue · 2 comments

Using this public key (see below), I get this error:
Key length of [2047] is less than the required key length of 2048 bits
with this java snippet of code:
RSAVerifier verifier = RSAVerifier.newVerifier(publicKeyContent);
Can we have an option or parameter to allow 2047 as well as 2048? Or a parameter to turn off this key length check?
See this article
https://randomoracle.wordpress.com/2019/12/04/off-by-one-the-curious-case-of-2047-bit-rsa-keys/

-----BEGIN PUBLIC KEY-----
MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBxbF2xqMaW05S4+qgaWUya
6e2QfXt7hNRFW/z7PlygU5D4lol6dfCiTEkgCHCiuYU7T7tmzNhqlMxKf8cj0XSo
UDvhmAfB9+pLx5hVsqHQlAJA4f5/q3oj7/bT6exfK6xsDlSAlAuxMy/gwVx8Zcbw
zxjFcK6S4o75Lr1zK40MfGKFOcbaNs/ma7F59R5ttXU0Y1gTnup2DZx5Z9TudWsB
jJoAhXV4dZN8uGeneD/2raLbKHWT1lCWzCwSwTSvMefRLwxCxfX+eXA0Vle9zPT8
P8xr2QXOJ7u4VPYjwrQdCpPbPdOENiIBhb0dwU7hrjGjRDZ3O2z1x7VbC7B5oX5b
AgMBAAE=
-----END PUBLIC KEY-----

Interesting, it looks like it is possible to generate a key that is 2047 bits.. perhaps I just need to allow either as they both seem to be ok.

Fixed in 5.1.1