-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
identity: fuzz Keypair::sign
to check whether our configuration can ever fail on RSA
#4650
Comments
I've looked into the code and the only way for |
Are we sure that |
It would be great if we could do at least some of the fuzzy testing mentioned in this issue to really be sure. |
Hmm, OK I'll try. The only reference I have in hand is #2119, It will take some time to learn how to write fuzz testings, but I'll keep things updated. |
The next possible failure for
Next part will be quite tricky because there are a lot of Then
In general the error shouldn't happen, and when it do happen it's mostly related to the key itself or the computations being done, but that's only my opinion. |
thanks for your input @elenaf9. looking more into this issue, I don't think it makes #5728 makes sense as it is, namely to have an intermediate pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, Infallible> { which will imply double breaking changes, I'd suggest we maintain what we have until if/when pub fn sign(&self, msg: &[u8]) -> Vec<u8> { is possible |
Yeah users can always do something unexpected. ig there is no way we remove the Signing error unless we stop supporting RSA. EDIT: Maybe we can check the key with some random bytes when importing a key to see if it's safe to use? |
@jxs What's your opinion on this? I believe if we want to fuzz test |
Description
Currently,
KeyPair::sign
can return an error if the keypair is RSA. This is annoying and leads to many "this should never happen" errors. We should fuzz the interface to check whether that can actually happen and making it infallible if we can't detect any cases.Motivation
Infallible code is easier to reason about.
Current Implementation
The function can technically fail.
Are you planning to do it yourself in a pull request ?
Yes
The text was updated successfully, but these errors were encountered: