From 624947cd6d884a10d5f1e984612f25ea07a1ffbb Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 19 Nov 2013 10:46:58 -0800 Subject: Doh, fix --- cryptography/hazmat/primitives/padding.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3