aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
diff options
context:
space:
mode:
authorDaniel Kestrel <kestrel1974@t-online.de>2021-06-15 17:23:05 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-01-06 00:22:59 +0100
commit0470b05b568c9d9b7188e83c1303d0acac64921d (patch)
treea7ee4c8a1e8372663b89059edd9b8a66795bd58b /package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
parent85383b311212576e7afd9d01dec49f69ef6fb886 (diff)
downloadupstream-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/kernel/lantiq/ltq-deu/src/ifxmips_md5.c')
0 files changed, 0 insertions, 0 deletions