-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
The logic in bytes/splitSignature is unreliable #2084
Comments
Thanks. I’ll look into this. Any non-ambiguous input should be supported, and yes I want the output to normalize all values. There are a lot of possible combinations, and I think I may have to visit simplifying the code. There also seems to be some weirdness in how some hardware wallet manufactures interpreted certain values if v. In v6, this is a proper object with methods that can validate all the fields make sense. |
My main concern about that is that c47d2eb added support for |
Fixing this now. The first two have an S that is out-of-range for canonical signatures, which is why it is failing. The first nibble must but less than 8. The last few are a bug though, which I'm fixing now and will go out in the next version. :) |
This should be fixed in 5.5.0. If you still have problems, let me know and please re-open this issue. Thanks for your attention to detail! :) |
Refs: c47d2eb#r55493545
splitSignature
supports different input modes, like:v
v
andrecoveryParam
presentv
present andrecoveryParam
isn'trecoveryParam
present andv
isn'tThe codepaths inside
splitSignature()
for those are inconsistent and don't check/normalize the input in a reliable way.To check this, the easiest would be to try passing the output of one
splitSignature
call back intosplitSignature
in a different form and see what happens.Judging by the code, all of those modes were intended to be supported.
When the second call fails, I would expected the first call also to fail or to return the output in a normalized form.
The text was updated successfully, but these errors were encountered: