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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid returning correct signature #862

Merged
merged 3 commits into from
Dec 9, 2020
Merged

Avoid returning correct signature #862

merged 3 commits into from
Dec 9, 2020

Conversation

tyrannosaurus-becks
Copy link
Contributor

Closes #849

This PR updates the code to avoid returning the correct signature. This prevents a malicious caller from viewing the error, updating their signature to the now known correct one, and re-executing the call.

A maintainer stated that if we were to remove the explicitly correct signature, it would be nice to also log the correct one at the debug level. To do that without changing the signature of the NewSecretsVerifier method, I added a WithDebug method that could be optionally called when creating the verifier, which follows the Builder pattern. It would have been strange to take an argument that was an unexported interface, so I also exported the Debug interface. That makes this change is 100% backwards compatible.

Happy to change my approach, add tests, or anything else that might help. A big thank-you to this repo's maintainers! 馃槃

Copy link
Member

@kanata2 kanata2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤
Thanks!

@kanata2 kanata2 merged commit a2a719f into slack-go:master Dec 9, 2020
@tyrannosaurus-becks
Copy link
Contributor Author

銇傘倞銇屻仺銇嗐仈銇栥亜銇俱仚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error from "Ensure" should not disclose expected signature
2 participants