mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
In the CCM B0 block the message-length field Q spans L bytes, where
L (cl in the driver) is derived from the cipher IV flags byte as
c_ivin[0] + 1. set_aead_auth_iv() hardcoded writing only the last 2
bytes of a_ivin with cryptlen, implicitly assuming cl = 2.
When cl = 3 (a shorter nonce yielding a 3-byte length field) and the
packet is longer than 65535 bytes, cryptlen no longer fits in 2 bytes.
The dropped high byte made the auth IV built by the driver differ from
the one consumed by the hardware, so the software/hardware comparison
failed and the CCM request errored out.
Write the last cl bytes of a_ivin in a loop driven by the IV's CL
value, so the length-field width always matches the algorithm
configuration instead of assuming a fixed 2-byte field.
Fixes:
|
||
|---|---|---|
| .. | ||
| hpre | ||
| sec | ||
| sec2 | ||
| zip | ||
| debugfs.c | ||
| Kconfig | ||
| Makefile | ||
| qm_common.h | ||
| qm.c | ||
| sgl.c | ||