diff options
author | Maciej Jurczak <mjurczak@gmail.com> | 2020-03-28 17:41:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 12:41:40 -0400 |
commit | 62287ae18383447585606b9d0765c0f1b8a9777c (patch) | |
tree | bf34f7260c499ccda78dbeee15333465468585fb | |
parent | 0833e93cd2ffaba708aca4050a319153325692a1 (diff) | |
download | cryptography-62287ae18383447585606b9d0765c0f1b8a9777c.tar.gz cryptography-62287ae18383447585606b9d0765c0f1b8a9777c.tar.bz2 cryptography-62287ae18383447585606b9d0765c0f1b8a9777c.zip |
Fixed error message in AES-CCM data length validation to reflect the error reason more accurately. (#5157)
-rw-r--r-- | src/cryptography/hazmat/primitives/ciphers/aead.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |