-
Notifications
You must be signed in to change notification settings - Fork 180
Description
there is a limit on RSA keys when using from_public_key_pem (returning KeyMalformed).
sadly, there are situations where its not feasible to either 1. use the *_with_max_size (because of using an external crate, like jsonwebtoken) or 2. change the infrastructure (company policy).
luckily for us, there's a workaround: using aws_lc_rs instead of ring circumvents the problem by not using the code.
in #210, it was noted that raising the limit is an option. personally, i don't think that the default limit is sensible. most applications don't read public keys from outside sources (preventing a DoS somehow implies an attacker, or not?).
when a key is loaded from an external source, it can reasonably be expected to verify the key. i'm of the opinion that the caller is responsible to specify a limit when loading a key from a potentially adversarial environment. they would have to be mindful of that any way.
it is easy to add an extra check before calling the primitives but it's rather difficult to take back a check that is built into the primitive.