Legrandin / pycryptodome

A self-contained cryptographic library for Python
https://www.pycryptodome.org
Other
2.74k stars 492 forks source link

AES-CCM enforce max length #779

Open solney opened 8 months ago

solney commented 8 months ago

NIST Special Publication 800-38C Appendix 1 states that the maximum length of payload is determined by the value of q (which in turn is related to the length of the nonce).

It seems as if this condition wasn't previously enforced which could lead to the block b0 exceeding 16 bytes.

solney commented 8 months ago

Just looking into the python2 failures now

solney commented 8 months ago

Just looking into the python2 failures now

Fixed now, need bytearray instead of bytes in new test