Skip to content
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

Signature.verify_msg requires both return value checking and error handling. #59

Open
pipermerriam opened this issue May 26, 2019 · 0 comments
Labels

Comments

@pipermerriam
Copy link
Member

What was wrong?

https://github.com/ethereum/trinity/pull/586/files#r287599483

Code that wants to verify signatures is required to both do error handling and return value checking when calling Signature.verify_msg due to the function returning a boolean and potentially raising a BadSignature in the event of a corrupt signature.

How can it be fixed?

The naive thing to do is have that method convert BadSignature to a False return but I think that is wrong since it conflates a corrupt signature with a signature that doesn't validate.

This probably needs to be split into a two part check so that the two concepts remain distinct, allowing the user to check if the signature itself is valid in isolation and then to check if it is a valid signature for a message.

pacrob pushed a commit to pacrob/eth-keys that referenced this issue Dec 20, 2023
Show full explanation for pydocstyle failures
@pacrob pacrob added the p3 label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants