Skip to content

Commit

Permalink
Removed asserts followed by error handling (cloudflare#142)
Browse files Browse the repository at this point in the history
The removed asserts resulted in the error handling code being
unreachable.
  • Loading branch information
robinhundt authored Sep 10, 2020
1 parent f824287 commit 2660747
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/crypto/blake2s/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ impl Blake2s {

/// Checks if both MACs are equal in constant time.
pub fn constant_time_mac_check(mac1: &[u8], mac2: &[u8]) -> Result<(), WireGuardError> {
assert!(mac1.len() == 16);
assert!(mac2.len() == 16);
if mac1.len() != 16 || mac2.len() != 16 {
return Err(WireGuardError::InvalidMac);
}
Expand Down

0 comments on commit 2660747

Please sign in to comment.