-
Notifications
You must be signed in to change notification settings - Fork 773
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
Should verifySignature really verify signature? #713
Comments
ping @holgerd77 |
Hi Kirill, thanks for your PR on this, just for some context: I am not so super-deep into this library so it always takes me some time to dig into stuff like this and understand the implications. If someone else also want to comment on this or give an assessment, that would also help. |
@fanatid Can you clarify: do you mean doing verification beyond what |
|
Sorry for the slow delay. I've just finished making some improvements to the code, and should be able to resolve this quickly now.
Okay, I think I see what you are saying, I need a little more clarification. Right now, And is your open PR on this issue meant to be a failing test that another change will fix? |
Yes, I propose that after public key recovering library should verify signature against this key. |
I have been looking into this. From my understanding when constructing a I understand why OP is confused because he is in fact right that the method does not verify the signature against a separately passed The test case proposed in ethereumjs/ethereumjs-tx#105 actually works as intended (other than the name being confusing) as modifying the A better case to test, that passes, is that modifying the signature changes the intended sender address: t.test(
"should return a different sender address of a modified signature",
function(st) {
var tx = new Transaction(transactions[0].serialize());
tx.r[0] += 1;
tx.verifySignature();
st.notEqual(transactions[0].sendersAddress, tx.getSenderPublicKey());
st.end();
}
); At this point it looks this like this issue and ethereumjs/ethereumjs-tx#105 can be closed. |
Right now method verifySignature just restore public key from signature, but does not really verify that restored public key corresponds to private key which was used for signing transaction. Should we restore public key and then verify signature with it right after?
The text was updated successfully, but these errors were encountered: