diff options
author | Daniel Kestrel <kestrel1974@t-online.de> | 2021-06-15 17:23:05 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-01-06 00:22:59 +0100 |
commit | 0470b05b568c9d9b7188e83c1303d0acac64921d (patch) | |
tree | a7ee4c8a1e8372663b89059edd9b8a66795bd58b /package/devel/trace-cmd | |
parent | 85383b311212576e7afd9d01dec49f69ef6fb886 (diff) | |
download | upstream-0470b05b568c9d9b7188e83c1303d0acac64921d.tar.gz upstream-0470b05b568c9d9b7188e83c1303d0acac64921d.tar.bz2 upstream-0470b05b568c9d9b7188e83c1303d0acac64921d.zip |
ltq-deu: fix temp size exceed in hmac algorithms
Exceeding the temp array size was not checked and instead storage not
allocated by the driver was used/overwritten which in most cases
resulted in reboots. This patch implements processing the input to the
hash algorithm in tempsize chunks.
The _hmac_final methods were changed to _hmac_final_impl adding a
parameter that indicates intermediate or final processing. The started
variable was added to the context to indicate, if there is an
intermediate result in the context. For sha1_hmac the variable to store
the intermediate hash was added to the context too.
In order to avoid md5_hmac_final_impl being recursively called if the
padding of the input and the resulting last transform during the hmac
algorighms final processing causes the temp array to overflow and to
make sure that there is at least one block in the temp array when the
_hmac_final for final processing is called, the check for exceeding
the temp array in _hmac_transform was moved before copying the block
and incrementing dbn. dbn needs to be at least 1 at final processing
time to let the hash engine apply the opad operation.
To make the hash engine not apply the hmac algorithms final opad
operation, for intermediate processing the dbn in the control register
is set to a higher value than number of dbns are actually processed.
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
Diffstat (limited to 'package/devel/trace-cmd')
0 files changed, 0 insertions, 0 deletions