From 62287ae18383447585606b9d0765c0f1b8a9777c Mon Sep 17 00:00:00 2001 From: Maciej Jurczak Date: Sat, 28 Mar 2020 17:41:40 +0100 Subject: Fixed error message in AES-CCM data length validation to reflect the error reason more accurately. (#5157) --- src/cryptography/hazmat/primitives/ciphers/aead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cryptography/hazmat/primitives/ciphers/aead.py b/src/cryptography/hazmat/primitives/ciphers/aead.py index 42e19adb..a20a80f3 100644 --- a/src/cryptography/hazmat/primitives/ciphers/aead.py +++ b/src/cryptography/hazmat/primitives/ciphers/aead.py @@ -126,7 +126,7 @@ class AESCCM(object): # https://tools.ietf.org/html/rfc3610#section-2.1 l_val = 15 - len(nonce) if 2 ** (8 * l_val) < data_len: - raise ValueError("Nonce too long for data") + raise ValueError("Data too long for nonce") def _check_params(self, nonce, data, associated_data): utils._check_byteslike("nonce", nonce) -- cgit v1.2.3