tn3399_openwrt/package
Mathias Kresin ab270c6fbc ltq-deu: aes: do not read/write behind buffer
When handling non-aligned remaining data (not padded to 16 byte
[AES_BLOCK_SIZE]), a full 16 byte block is read from the input buffer
and written to the output buffer after en-/decryption.

While code already assumes that an input buffer could have less than 16
byte remaining, as it can be seen by the code zeroing the remaining
bytes till AES_BLOCK_SIZE, the full AES_BLOCK_SIZE is read.

An output buffer size of a multiple of AES_BLOCK_SIZE is expected but
never validated.

To get rid of the read/write behind buffer, use a temporary buffer when
dealing with not padded data and only write as much bytes to the output
as we read.

Do not memcpy directly to the register, to make used of the endian swap
macro and to trigger the crypto start operator via the ID0R to trigger
the register. Since we might need an endian swap for the output in
future, use a temporary buffer for the output as well.

The issue could not be observed so far, since all caller of ifx_deu_aes
will ignore the padded (remaining) data. Considering that the minimum
blocksize for the algorithm is set to AES_BLOCK_SIZE, the behaviour
could be called expected.

Signed-off-by: Mathias Kresin <dev@kresin.me>
[fix commit title prefix]
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
2022-01-05 23:05:38 +01:00
..
base-files base-files: upgrade: fix efi partitions size calculation 2021-12-27 13:51:41 +01:00
boot kirkwood: add support for NETGEAR ReadyNAS Duo v2 2021-12-29 20:35:57 +01:00
devel binutils: fix compiling with arch-based distros 2022-01-02 20:33:28 +01:00
firmware linux-firmware: amd: consolidate amd's linux-firmware entries 2021-12-27 13:51:41 +01:00
kernel ltq-deu: aes: do not read/write behind buffer 2022-01-05 23:05:38 +01:00
libs openssl: bump to 1.1.1m 2022-01-01 18:02:49 +01:00
network hostapd: refresh patchset 2021-12-31 12:11:59 +01:00
system procd: update to git HEAD 2021-12-20 02:23:47 +00:00
utils lua: add HOST_FPIC for host builds 2022-01-03 10:34:31 +01:00
Makefile build: fix opkg install step for large package selection 2021-05-12 11:13:53 +02:00