Minor cleanup of raft encryption algorithms #2635
Merged
anshulpundir merged 1 commit intomoby:masterfrom May 21, 2018
Merged
Conversation
function easier to read. Also change the error messages returned by fernet and nacl decryption to be more friendly. Signed-off-by: Ying Li <ying.li@docker.com>
justincormack
approved these changes
May 17, 2018
Codecov Report
@@ Coverage Diff @@
## master #2635 +/- ##
==========================================
- Coverage 62.59% 62.38% -0.21%
==========================================
Files 51 134 +83
Lines 7180 21823 +14643
==========================================
+ Hits 4494 13615 +9121
- Misses 2231 6749 +4518
- Partials 455 1459 +1004 |
anshulpundir
approved these changes
May 21, 2018
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As @justincormack pointed out in #2632,
MultiDecrypter'sDecryptfunction is somewhat hard to read, and there are no tests for the fallthrough case. This PR adds those fallthrough tests and also uses explicit returns rather than named return variables in theDecryptfunction.Also changes the error message when we can't decrypt the record to be slightly more friendly.