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.
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
chore: return generic errors for aes256cbc encrypt and decrypt #509
chore: return generic errors for aes256cbc encrypt and decrypt #509
Changes from 7 commits
7a6ddb3
20febd0
15b0155
9d49515
aa8a3fd
f823427
ff0c66d
4a6dba4
0801ef9
56bfad0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea to mask all errors with the same error. It's okay to return the same error type, but it should not be the same error message for different types of errors, the actual error is getting masked here. It'll be harder to debug the reason just by seeing "error in decryption".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that in the future we will create a variable for each type of error, making the code more maintainable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hasitpbhatt thank you for taking the time to leave a review on this PR. Sorry for the delay getting back to you I was off for a while. I would love to hear about how you found out about Mailchain and if there is anything I can do to help you. Please feel free to comment here or join our slack channel
You raise an excellent point about the outcome from a developer perspective. The reason for masking the error is to reduce the information an attacker might get from an error. This does need more thought overall so I have opened an issues #532 to discuss this.
In the meantime @developerfred I will merge this change as it resolves the issue as originally defined. Once #532 is resolved we will come back to this