2019-09-26 01:56 AM
I have a file from ST, not sure where it comes from but the header has:
sha1_alt.c for SHA1 HASH
Copyright (c) 2017, STMicroelectronics
I am getting issues with the function that call HAL_HASH_SHA1_Accumulate function.
They are no checking for size/len if it is 0.
For some reason I am getting this issue but not sure if its this file or the application issue.
Shall it checks if size is >0 ?
Do you have an updated version of this file?
2019-09-26 08:25 AM
I also found that this functions are not working with data length not multiple of 4. Shall it handle this not multiple cases?
2019-09-26 08:31 AM
It is documented as requiring 4-byte multiple. You're expected to either use it for large block, or wrap it with some spill buffer method to meet the requirements of the underlying hardware.
2019-09-27 04:56 AM
I found that it misses a padding as described here:
https://tools.ietf.org/html/rfc3174#section-4
mbed crypto software implementation is adding that padding:
so as far as I understand, this sha1_alt.c that I have is not implementing the required padding.