diff options
-rw-r--r-- | cryptography/hazmat/primitives/padding.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cryptography/hazmat/primitives/padding.py b/cryptography/hazmat/primitives/padding.py index d185fb6f..4e834726 100644 --- a/cryptography/hazmat/primitives/padding.py +++ b/cryptography/hazmat/primitives/padding.py @@ -49,7 +49,8 @@ bool Cryptography_check_padding(const uint8_t *data, uint8_t block_len) { } /* Check to make sure the pad_size was within the valid range. */ - mismatch |= ~(0 < pad_size <= block_len); + mismatch |= !(0 < pad_size); + mismatch |= !(pad_size <= block_len); /* Make sure any bits set are copied to the lowest bit */ mismatch |= mismatch >> 4; |