You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems like the issue is in the v component of the signature and the values that are passed. Looking at this status-go function, if the value is 1, it gets set to 0 instead, invalidating the signature. Seems like for a v of 1, we should just send "01" as it expects, instead of parsing it and sending "1".
So it makes sense that it would fail just sometimes, since when v is 0 it should work as expected, cause it's the default.
rBytes, _:=hex.DecodeString(sigDetails.R)
sBytes, _:=hex.DecodeString(sigDetails.S)
vByte:=byte(0)
ifsigDetails.V=="01" { // here is the check, but it's weird vByte=1
}
desc.signature=make([]byte, crypto.SignatureLength)
copy(desc.signature[32-len(rBytes):32], rBytes)
copy(desc.signature[64-len(rBytes):64], sBytes)
desc.signature[64] =vByte// otherwise becomes 0 here
Testing
I checked a few times and seems to work, but don't have enough funds to test it as much
The reason will be displayed to describe this comment to others. Learn more.
Could we move this function to a utils file?
Also, wdyt of adding unit tests for this function? I think it can serve as documentation for a complex feature like keycard.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #21533
Summary
Seems like the issue is in the
v
component of the signature and the values that are passed. Looking at this status-go function, if the value is 1, it gets set to 0 instead, invalidating the signature. Seems like for a v of 1, we should just send "01" as it expects, instead of parsing it and sending "1".So it makes sense that it would fail just sometimes, since when v is 0 it should work as expected, cause it's the default.
Testing
I checked a few times and seems to work, but don't have enough funds to test it as much
status: ready